Read JCAMP-DX-formatted files
JCAMPStruct
=
jcampread(File
)
File | Either of the following:
|
JCAMPStruct | MATLAB structure containing information from a JCAMP-DX-formatted file. |
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:
reads data from JCAMPStruct
=
jcampread(File
)File
,
a JCAMP-DX-formatted file, and creates JCAMPStruct
,
a MATLAB structure containing the following fields.
Field |
---|
Title |
DataType |
DataClass (version 5.00 and above) |
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 |
ZData (if multiple blocks) |
XUnits |
YUnits |
ZUnits (if multiple blocks) |
Notes |
Open a Web browser to http://www.jcamp-dx.org/testdata.html.
Download the testdata.zip
file
to your MATLAB Current Folder.
Extract isas_ms1.dx
, a JCAMP-DX-formatted
file, from the testdata.zip
file to your MATLAB Current
Folder.
Read the data from the JCAMP-DX-formatted file, isas_ms1.dx
,
into the MATLAB software
jcampStruct = jcampread('isas_ms1.dx') jcampStruct = Title: '2-Chlorphenol' DataType: 'MASS SPECTRUM' DataClass: 'PEAKTABLE' Origin: 'H. Mayer, ISAS Dortmund' Owner: 'COPYRIGHT (C) 1993 by ISAS Dortmund, FRG' Blocks: [1x1 struct] Notes: {8x2 cell}
Plot the mass spectrum.
data = jcampStruct.Blocks(1); stem(data.XData,data.YData, '.', 'MarkerEdgeColor','w'); title(jcampStruct.Title); xlabel(data.XUnits); ylabel(data.YUnits);