LabKit MATLAB Workbench

reference

API ReferenceBiosignal API

labkit.biosignal.getChannel

Return one signal from a recording by display name or index.

Syntax

signal = labkit.biosignal.getChannel(recording, channel)

Description

Selects one channel from a recording created by labkit.biosignal.readRecording. A numeric channel is interpreted as a 1-based index. Text is matched exactly against displayName first and then against the source name. Matching is case-sensitive.

Use labkit.biosignal.listChannels to obtain the display names presented by the recording. Display names are unique even when source channel names are repeated.

Inputs

recording
Recording structure returned by labkit.biosignal.readRecording.
channel
Positive integer index, character vector, or scalar string containing a channel name or display name.

Outputs

signal
Selected signal structure. Its principal fields are time in seconds, values, fs in hertz, name, displayName, unit, and metadata.

Errors

labkit:biosignal:InvalidRecording
recording has no signals field.
labkit:biosignal:NoChannels
recording contains no signals.
labkit:biosignal:InvalidChannelIndex
numeric index is not an integer within the available range.
labkit:biosignal:InvalidChannel
channel has an unsupported type.
labkit:biosignal:UnknownChannel
no exact name matches channel.

Example

channel = struct('name', "ECG", 'displayName', "ECG", ...
'time', [0; 0.01], 'values', [0; 1], 'fs', 100, ...
'unit', "mV", 'metadata', struct());
recording = struct('signals', channel);
signal = labkit.biosignal.getChannel(recording, "ECG");

Source

This page is generated from the MATLAB help text in +labkit/+biosignal/getChannel.m.