Main Content

reset

Reset datastore read pointer to start of data

Description

reset(ADS) resets the datastore read pointer to the start of the data. Resetting allows re-reading from the same datastore.

example

Examples

collapse all

Create an audioDatastore object ADS.

folder = fullfile(matlabroot,'toolbox','audio','samples');
ADS = audioDatastore(folder);

While the datastore has unread files, call read in a loop to read files sequentially.

while hasdata(ADS)
    data = read(ADS);
end

Reset the datastore to the state where no data has been read from it. Read the first file from the datastore.

reset(ADS)
data = read(ADS);

Input Arguments

collapse all

Specify ADS as an audioDatastore object.

Version History

Introduced in R2018b