preview

Read first signal observation from datastore for preview

Description

example

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.

Examples

collapse all

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')

Input Arguments

collapse all

Signal datastore, specified as a signalDatastore object.

Output Arguments

collapse all

First observation from sds, returned as signal data.

Introduced in R2020a