shuffle
Shuffle all data in datastore
Syntax
Description
Examples
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
Input datastore, specified as a datastore object. The input datastore can
be any datastore for which isShuffleable returns true (such as
imageDatastore). The input
datastore also can be a CombinedDatastore, SequentialDatastore, or TransformedDatastore for which all underlying datastores are
shuffleable.
Output Arguments
Output datastore, returned as a datastore object containing randomly
ordered data from ds.
Extended Capabilities
Usage notes and limitations:
In a thread-based environment, you can use
shuffleonly with the following datastores:ImageDatastoreobjectsCombinedDatastore,SequentialDatastore, orTransformedDatastoreobjects you create fromImageDatastoreobjects by usingcombineortransform
You can use
shufflewith other datastores if you have Parallel Computing Toolbox™. To do so, run the function using a process-backed parallel pool instead of usingbackgroundPoolorThreadPool(use eitherProcessPoolorClusterPool).
For more information, see Run MATLAB Functions in Thread-Based Environment.
Version History
Introduced in R2016a
See Also
ImageDatastore | datastore | isShuffleable | matlab.io.Datastore
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)