reset
Class: matlab.io.datastore.DsFileSet
Namespace: matlab.io.datastore
Reset the file-set object
Syntax
reset(fs)
Description
reset(
resets the file-set object
fs
)fs
to the state where no file has been read from it. Resetting
enables rereading from the same file-set object.
Input Arguments
Examples
Reset File-Set Object
Create a file-set object, get file information from the file-set object, and then reset the file-set object to its original state.
Create a file-set object for all the .mat
files in the
demos
folder.
folder = fullfile(matlabroot,'toolbox','matlab','demos'); fs = matlab.io.datastore.DsFileSet(folder,... 'IncludeSubfolders',true,... 'FileExtensions','.mat');
While there are files in the file-set object, get the file information one file at a time.
while hasfile(fs) file = nextfile(fs); end
The nextfile
operation changes the position pointer in the
file-set object. To get the information on the first file, you must first
reset
the file-set
object.
reset(fs);
fTable1 = nextfile(fs); % first file information
Version History
Introduced in R2017b