jcampread
Read JCAMP-DX-formatted files
Description
reads data from JCAMPStruct = jcampread(myFile)myFile, a JCAMP-DX-formatted
file, and returns the data in a MATLAB® structure.
Examples
Read the data from the JCAMP-DX-formatted file, ISAS_MS1.DX, provided with the software. The data came from http://www.jcamp-dx.org/testdata.html.
jcampStruct = jcampread('ISAS_MS1.DX')jcampStruct = struct with fields:
Title: '2-Chlorphenol'
DataType: 'MASS SPECTRUM'
DataClass: 'PEAKTABLE'
Origin: 'H. Mayer, ISAS Dortmund'
Owner: 'COPYRIGHT (C) 1993 by ISAS Dortmund, FRG'
Blocks: [1×1 struct]
Notes: {8×2 cell}
Plot the mass spectrum.
stem(jcampStruct.Blocks.XData,jcampStruct.Blocks.YData, ".",MarkerEdgeColor="w"); title(jcampStruct.Title); xlabel(jcampStruct.Blocks.XUnits); ylabel(jcampStruct.Blocks.YUnits);

Input Arguments
Input file, specified as one of these options.
Character vector or string scalar 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 folder.
MATLAB character array that contains the text of 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 information about the
JCAMP-DX format, see http://www.jcamp-dx.org/testdata.html.
Data Types: char | string
Output Arguments
Information extracted from the JCAMP-DX-formatted
file, returned as a MATLAB structure.
JCAMPStruct contains these
fields.
| Field | Description |
|---|---|
Title | Title of the dataset |
DataType | Type of data contained in the file |
DataClass (version 5.00
and above) | Class of data |
Origin | Origin of the data |
Owner | Owner of the data |
Blocks | Array of structures |
Notes | Additional comments |
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 | Description |
|---|---|
XData | x data values |
YData | y data values |
ZData (if multiple
blocks) | z data values |
XUnits | Units of the x data |
YUnits | Units of the y data |
ZUnits (if multiple
blocks) | Units of the z data |
Notes | Additional comments |
Data Types: struct
Version History
Introduced before R2006a
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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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)