This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

shuffle

Shuffle files in ImageDatastore

Syntax

imdsrand = shuffle(imds)

Description

example

imdsrand = shuffle(imds) returns an ImageDatastore object containing a random ordering of the files from imds.

Examples

collapse all

Create an ImageDatastore object imds. Shuffle the files to create a new datastore containing the same files in random order.

imds = imageDatastore(fullfile(matlabroot, 'toolbox', 'matlab', {'demos','imagesci'}),'LabelSource','foldernames','FileExtensions', {'.jpg', '.png', '.tif'})
imds = 

  ImageDatastore with properties:

      Files: {
             ' ...\matlab\toolbox\matlab\demos\cloudCombined.jpg';
             ' ...\matlab\toolbox\matlab\demos\example.tif';
             ' ...\matlab\toolbox\matlab\demos\landOcean.jpg'
              ... and 5 more
             }
     Labels: [demos; demos; demos ... and 5 more categorical]
    ReadFcn: @readDatastoreImage

imdsrand = shuffle(imds)
imdsrand = 

  ImageDatastore with properties:

      Files: {
             ' ...\matlab\toolbox\matlab\demos\street2.jpg';
             ' ...\matlab\toolbox\matlab\demos\landOcean.jpg';
             ' ...\matlab\toolbox\matlab\imagesci\corn.tif'
              ... and 5 more
             }
     Labels: [demos; demos; imagesci ... and 5 more categorical]
    ReadFcn: @readDatastoreImage

Input Arguments

collapse all

Input datstore, specified as an ImageDatastore object. To create an ImageDatstore from your image data, use the imageDatastore function.

Output Arguments

collapse all

Output datastore, returned as an ImageDatastore object containing randomly ordered files from imds.

Introduced in R2016a