%% Remove Point Value
% Load a labeled signal set containing recordings of whale songs. Get the names of the labels and the number of members.

load whales
lss
nm = lss.NumMembers;

%
% Define a point label associated with the signal maximum.

themax = signalLabelDefinition('Maximum','LabelType','point', ...
    'LabelDataType','numeric')
addLabelDefinitions(lss,themax)

%
% Find the maxima of the signals and add their values to the labeled set.

figure
for idx = 1:nm
    sg = getSignal(lss,idx);
    [mx,ix] = max(sg);
    setLabelValue(lss,idx,'Maximum',ix,mx)
    
    subplot(nm,1,idx)
    plot((0:length(sg)-1)/lss.SampleRate,sg,ix/lss.SampleRate,mx,'*')
end

% Verify that the set includes the new point label.

getLabelValues(lss)

% Remove the 'Maximum' value for the first member of the set. Verify that the label is empty for the first member.

removePointValue(lss,1,'Maximum')

getLabelValues(lss,1)

% Copyright 2018 The MathWorks, Inc.