tgspcread
Read data from SPC file
Description
sets file reading parameters using one or more optional name-value arguments. For
example, SPCStruct
= tgspcread(myFile
,Name=Value
)Verbose=true
sets the display control of the file
reading progress to true
.
Examples
To read and plot an SPC file, follow the steps in this
example. This example assumes that you already have an SPC file to use.
Bioinformatics Toolbox™ does not include a sample.spc
file.
Read an SPC file.
% Read the contents of an SPC file into a MATLAB structure out = tgspcread('results.spc')
File contains 1 scans out = Header: [1x1 struct] X: [12031x1 single] Y: [12031x1 double] Z: 0
Plot an SPC file.
% Plot the first scan in the SPC file:
plot(out.X,out.Y(:,1));
Input Arguments
Input file, specified as a character vector or string containing an SPC file name or the path and file name of an SPC file. The SPC file must conforms to the Thermo Scientific Universal Data Format Specification. If you specify only a file name, that file must be on the MATLAB search path or in the current folder.
Data Types: char
| string
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: For example, Verbose=true
sets the display control of
the file reading progress to true
.
Range of z data values in
myFile
to read, specified as a two-element
numeric array [Start
End]. The Start value must be less
than the End value. By default, the
tgspcread
function extracts all available scans
from the file.
Tip
For summary information about the z data
values in an SPC file, see the tgspcinfo
function.
Dependencies
To use this name-value argument, you must not specify
ScanIndices
.
Data Types: double
Scans in the input file to read, specified as a positive integer (one
scan), a vector of integers (multiple scans), or a two-element numeric
array [StartInd: EndInd]
(range of scans).
StartInd and EndInd are each
positive integers indicating a scan index. The StartInd
value must be less than the EndInd value.
If you do not specify a range, by default, the
tgspcread
function reads all available scans
from the file.
Tip
For summary information about the scan indices in an SPC file,
check the NumScans
field in the structure
returned by the tgspcinfo
function.
Dependencies
To use this name-value argument, you must not specify
ZRange
.
Data Types: double
Display control of the file reading progress, specified as
true
(1
) or
false
(0
).
Data Types: logical
Output Arguments
Information extracted from an SPC file, returned as a structure. The structure contains these fields.
Field | Description |
---|---|
Header | Structure containing these fields:
|
X | Vector or cell array containing the x data values. If
all scans share the same x data
values, then |
Y | Vector, matrix, or cell array containing the y data values. If
only one scan exists, |
Z | Vector containing the z data values of scans read from the SPC file |
Data Types: struct
Version History
Introduced in R2009b
See Also
tgspcinfo
| jcampread
| mzcdfinfo
| mzcdf2peaks
| mzcdfread
| mzxmlread
| mzxml2peaks
| mzxmlinfo
| datenum
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)