val = getLabelValues(lss,midx)
returns a table containing the label values for the member specified by
midx.
[val,sublbltbl] = getLabelValues(lss,midx,lblName)
returns the value of the label named lblName. If
lblName has sublabels, then the table
sublbltbl shows the structure of the label value and its sublabel
variables.
[___] = getLabelValues(___,'LabelRowIndex',ridx)
specifies the row index, ridx, of an ROI or point label whose value
you want to get.
[___] = getLabelValues(___,'SublabelRowIndex',sridx)
specifies the row index, sridx, of an ROI or point sublabel whose
value you want to get.
Load a labeled signal set containing recordings of whale songs.
load whales
lss
lss =
labeledSignalSet with properties:
Source: {2×1 cell}
NumMembers: 2
TimeInformation: "sampleRate"
SampleRate: 4000
Labels: [2×3 table]
Description: "Characterize wave song regions"
Use labelDefinitionsHierarchy to see a list of labels and sublabels.
Use setLabelValue to add data to the set.
Get the values of the labels.
lbls = getLabelValues(lss)
lbls=2×3 table
WhaleType MoanRegions TrillRegions
_________ ___________ ____________
Member{1} blue {3×2 table} {1×3 table}
Member{2} blue {3×2 table} {1×3 table}
Display the moan ROI limits for the second signal of the set.
Plot the trill region of the signal between the ROI limits. Display the labeled trill peaks.
tvals = getLabelValues(lss,2,'TrillRegions');
peaks = getLabelValues(lss,2,{'TrillRegions','TrillPeaks'});
sg = getSignal(lss,2);
plot((0:length(sg)-1)/lss.SampleRate,sg)
xlim(tvals.ROILimits)
hold on
plot(peaks.Location,cell2mat(peaks.Value),'v')
hold off
Example: labeledSignalSet({randn(100,1)
randn(10,1)},signalLabelDefinition("female")) specifies a two-member set of random
signals containing the attribute "female".
Member row number, specified as a positive integer. midx
specifies the member row number as it appears in the Labels table of a labeled signal
set.
Label or sublabel name. To specify a label, use a character vector or a string scalar. To
specify a sublabel, use a two-element cell array of character vectors or a two-element string array:
The first element is the name of the parent label.
The second element is the name of the sublabel.
Example: signalLabelDefinition("Asleep",'LabelType','roi') specifies a
label of name "Asleep" for a region of a signal in which a patient is
asleep during a clinical trial.
Example: {'Asleep' 'REM'} or ["Asleep" "REM"]
specifies a region of a signal in which a patient undergoes REM sleep.
Label row index, specified as a positive integer. This argument applies only for point, ROI
and time-frequency ROI labels.
Sublabel row index, specified as a positive integer. This argument applies only when a label
and sublabel pair has been specified in lblname and the sublabel is
of type ROI or point.