Main Content

preview

Read first signal observation from datastore for preview

Since R2020a

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 display the name of the first file.

folder = fullfile(matlabroot,'toolbox','matlab','audiovideo');
sds = signalDatastore(folder);
[~,c] = fileparts(sds.Files(1))
c = 1x1 cell array
    {'chirp'}

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.

Version History

Introduced in R2020a