shuffle
Description
creates a Deep Copy of the input datastore
shuffledsds
= shuffle(sds
)sds
and shuffles the signals using the randperm
function.
Examples
Shuffle Files in Signal Datastore
Specify the path to the example signals included with MATLAB®. Create a signal datastore that points to the specified folder and display the names of the files in the datastore.
folder = fullfile(matlabroot,'toolbox','matlab','audiovideo'); sds = signalDatastore(folder); [~,c1] = fileparts(sds.Files)
c1 = 7x1 cell
{'chirp' }
{'gong' }
{'handel' }
{'laughter'}
{'mtlb' }
{'splat' }
{'train' }
Shuffle the files to create a new datastore containing the same files in random order. Display the names of the files in the shuffled datastore.
sdsshuffled = shuffle(sds); [~,c2] = fileparts(sdsshuffled.Files)
c2 = 7x1 cell
{'splat' }
{'handel' }
{'train' }
{'mtlb' }
{'chirp' }
{'gong' }
{'laughter'}
Input Arguments
sds
— Signal datastore
signalDatastore
object
Signal datastore, specified as a signalDatastore
object.
Output Arguments
shuffledsds
— Shuffled signal datastore
signalDatastore
object
Shuffled signal datastore, returned as a signalDatastore
object containing randomly ordered files or members from
sds
.
More About
Deep Copy
A deep copy refers to a copy in which all levels of data are copied. For example, a deep copy of a structure copies each field and the contents of each field, if any.
Version History
Introduced in R2020a
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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)