Main Content

progress

Fraction of files read

Description

fractionRead = progress(ADS) returns the fraction of files read in the datastore as a normalized value in the range [0,1].

example

Examples

collapse all

Create an audioDatastore object ADS. Read a file from the datastore and then call progress to return the fraction of files read.

ADS = audioDatastore(fullfile(matlabroot,'toolbox','audio','samples'))
ADS = 
  audioDatastore with properties:

                       Files: {
                              ' .../matlab/toolbox/audio/samples/Ambiance-16-44p1-mono-12secs.wav';
                              ' .../matlab/toolbox/audio/samples/AudioArray-16-16-4channels-20secs.wav';
                              ' .../toolbox/audio/samples/ChurchImpulseResponse-16-44p1-mono-5secs.wav'
                               ... and 36 more
                              }
                     Folders: {
                              ' .../Bdoc24b.2679053/build/runnable/matlab/toolbox/audio/samples'
                              }
    AlternateFileSystemRoots: {}
              OutputDataType: 'double'
           OutputEnvironment: 'cpu'
                      Labels: {}
      SupportedOutputFormats: ["wav"    "flac"    "ogg"    "opus"    "mp3"    "mp4"    "m4a"]
         DefaultOutputFormat: "wav"

fractionOfFilesRead = progress(ADS)
fractionOfFilesRead = 
0
data = read(ADS);
fractionOfFilesRead = progress(ADS)
fractionOfFilesRead = 
0.0256

Input Arguments

collapse all

Specify ADS as an audioDatastore object.

Output Arguments

collapse all

Fraction of files read, returned as a normalized value in the range [0,1].

Data Types: double

Version History

Introduced in R2018b