LabKit MATLAB Workbench

reference

API ReferenceGamry DTA Files

labkit.dta.loadFile

Read one supported Gamry DTA file.

Syntax

[item, status] = labkit.dta.loadFile(filepath) [item, status] = labkit.dta.loadFile(filepath, expectedKind) [item, status] = labkit.dta.loadFile(filepath, expectedKind, opts)

Description

Detects and parses one chrono, EIS, or CV/CT DTA file. Set expectedKind to a specific family when a workflow must reject other DTA types. Parse and format failures are returned in status; invalid arguments throw errors.

Inputs

filepath
Character vector or string scalar naming one DTA file.
expectedKind
Character vector or string scalar. Allowed values are "auto", "chrono", "eis", and "cvct". Matching is case-insensitive, surrounding whitespace is ignored, and a blank value means "auto". Default: "auto".
opts
Optional scalar structure. Options apply to chrono loading only.

Options

pulseMode
Pulse-detection mode accepted by detectPulses, such as "Metadata first, then auto", "Metadata only", or "Auto from Im only".
pulseOptions
Structure with a mode field accepted by detectPulses. When both pulseOptions and pulseMode are present, pulseOptions takes precedence.

Outputs

item
Scalar parsed item structure when status.ok is true, or an empty structure array when loading fails. See Output Fields.
status
Scalar structure with ok, message, kind, expectedKind, and filepath fields. A kind mismatch reports both the expected and detected family in message.

Output Fields

type
"chrono", "eis", or "cvct".
filepath
Source path as a character vector.
name
Source filename including extension.
meta
Parsed metadata for chrono and EIS items.
tables
Parsed table structures for chrono and EIS items.
t_s
Chrono time in seconds.
Vf_V
Chrono measured voltage in volts.
Im_A
Chrono measured current in amperes.
pulse
Chrono pulse structure returned by detectPulses.
freq_Hz
EIS frequency in hertz.
Zreal_ohm
EIS real impedance in ohms.
Zimag_ohm
EIS imaginary impedance in ohms.
Zmod_ohm
EIS impedance magnitude in ohms.
Zphz_deg
EIS phase angle in degrees.
scanRate_V_per_s
CV/CT scan rate in volts per second.
curves
Parsed CV/CT curve structures in file order.
analysis
Empty structure reserved for caller-owned results.

Errors

Throws labkit:dta:InvalidFilepath for a nonscalar path and labkit:dta:InvalidKind for an unsupported expectedKind. Missing files, unsupported content, parse failures, and type mismatches are returned as status.ok=false rather than thrown.

Example

[item, status] = labkit.dta.loadFile("measurement.DTA", "eis");
if status.ok
semilogx(item.freq_Hz, item.Zmod_ohm)
else
warning("%s", status.message)
end

Source

This page is generated from the MATLAB help text in +labkit/+dta/loadFile.m.