%% Datastores and Labeled Signal Sets for Signal and Wavelet
% This example shows how datastores and labeled signal sets interact. Meant only to provide <examplesectionobject>s to the labeledSignalSet page. Not meant to be published on its own.
%
%% Load Sound Files
% Specify the path to a set of sample sound signals included as MAT-files with MATLAB®. Each file contains a signal variable and a sample rate. List the names of the files.

folder = fullfile(matlabroot,"toolbox","matlab","audiovideo");
lst = dir(append(folder,"/*.mat"));
nms = {lst(:).name}'

%
% Create a signal datastore that points to the specified folder. Set the sample rate variable name to Fs, which is common to all files. Generate a subset of the datastore that excludes the file mtlb.mat, which differs from the other files in that the signal variable is not called y.

sds = signalDatastore(folder,"SampleRateVariableName","Fs");
sdss = subset(sds,~strcmp(nms,"mtlb.mat"));

%
% Use the subset datastore as the source for a labeledSignalSet object.

lss = labeledSignalSet(sdss)

% Copyright 2021 The MathWorks, Inc.
%