%% Get Label Values
% Load a labeled signal set containing recordings of whale songs.

load whales
lss

%
% Get the values of the labels.

lbls = getLabelValues(lss)

% Display the moan ROI limits for the second signal of the set.

lbb = getLabelValues(lss,2,'MoanRegions')

% 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

% Display the coordinates of the third trill peak.

pcoor = getLabelValues(lss,2,{'TrillRegions','TrillPeaks'}, ...
    'LabelRowIndex',1,'SublabelRowIndex',3)

% Copyright 2018 The MathWorks, Inc.