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: 0Plot 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)