jcampread - Read JCAMP-DX-formatted files

Syntax

JCAMPStruct = jcampread(File)

Arguments

File

Either of the following:

  • String specifying a file name, a path and file name, or a URL pointing to a file. The referenced file is a JCAMP-DX-formatted file (ASCII text file). If you specify only a file name, that file must be on the MATLAB® search path or in the current directory.

  • MATLAB character array that contains the text of a JCAMP-DX-formatted file.

Return Values

JCAMPStructMATLAB structure containing information from a JCAMP-DX-formatted file.

Description

JCAMP-DX is a file format for infrared, NMR, and mass spectrometry data from the Joint Committee on Atomic and Molecular Physical Data (JCAMP). jcampread supports reading data from files saved with Versions 4.24, 5, or 6 of the JCAMP-DX format. For more details, see:

http://www.jcamp-dx.org/

JCAMPStruct = jcampread(File) reads data from File, a JCAMP-DX-formatted file, and creates JCAMPStruct, a MATLAB structure containing the following fields.

Field
Title
DataType
DataClass
Origin
Owner
Blocks
Notes

The Blocks field of the structure is an array of structures corresponding to each set of data in the file. These structures have the following fields.

Field
XData
YData
XUnits
YUnits
Notes

Examples

  1. Download test data in the file isa_ms1.dx from:

    http://www.jcamp-dx.org/testdata.html
    
  2. Read a JCAMP-DX file (isas_ms1.dx) into the MATLAB software and plot the mass spectrum.

    jcampStruct = jcampread('isas_ms1.dx') 
    data = jcampStruct.Blocks(1); 
    stem(data.XData,data.YData, '.', 'MarkerEdgeColor','w');
    title(jcampStruct.Title); 
    xlabel(data.XUnits); 
    ylabel(data.YUnits);

    A Figure window opens with the mass spectrum.

See Also

Bioinformatics Toolbox™ functions: mslowess, mssgolay, msviewer, mzxmlread

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS