data = preview(sds)
always reads the first file from the signal datastore in the case of file data, or the first
member in the case of in-memory data. A call to preview does not affect
the state of the signal datastore object.
Specify the path to four signals included with MATLAB®. Create a signal datastore that points to the specified folder and use the extractAfter function and display the name of the file previewed.
folder = fullfile(matlabroot,'toolbox','matlab','audiovideo');
sds = signalDatastore(folder);
c = extractAfter(sds.Files{1},'audiovideo\')
c =
0x0 empty char array
Plot the previewed data from the first file of sds.
data = preview(sds);
plot(data)
xlabel('Samples')
ylabel('Signal')