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.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)