shuffle
Shuffle files in datastore
Description
creates a deep copy of the input datastore, shuffledADS
= shuffle(ADS
)ADS
, and shuffles the files
using randperm
.
Examples
Shuffle Files
Create an audioDatastore
object ADS
. Shuffle the files to create a new datastore containing the same files in random order.
ADS = audioDatastore(fullfile(matlabroot,'toolbox','audio','samples'))
ADS = audioDatastore with properties: Files: { ' .../build/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: { ' .../filer/batfs1904-0/Bdoc24a.2528353/build/matlab/toolbox/audio/samples' } AlternateFileSystemRoots: {} OutputDataType: 'double' OutputEnvironment: 'cpu' Labels: {} SupportedOutputFormats: ["wav" "flac" "ogg" "opus" "mp3" "mp4" "m4a"] DefaultOutputFormat: "wav"
ADSshuffled = shuffle(ADS)
ADSshuffled = audioDatastore with properties: Files: { ' .../matlab/toolbox/audio/samples/TrainWhistle-16-44p1-mono-9secs.wav'; ' .../build/matlab/toolbox/audio/samples/Rainbow-16-8-mono-114secs.wav'; ' .../build/matlab/toolbox/audio/samples/Turbine-16-44p1-mono-22secs.wav' ... and 36 more } Folders: { ' .../filer/batfs1904-0/Bdoc24a.2528353/build/matlab/toolbox/audio/samples' } AlternateFileSystemRoots: {} OutputDataType: 'double' OutputEnvironment: 'cpu' Labels: {} SupportedOutputFormats: ["wav" "flac" "ogg" "opus" "mp3" "mp4" "m4a"] DefaultOutputFormat: "wav"
Input Arguments
ADS
— Input audio datastore
audioDatastore
object
Input audio datastore, specified as an audioDatastore
object.
Output Arguments
shuffledADS
— Shuffled audio datastore
audioDatastore
object
Shuffled audio datastore, returned as an audioDatastore
object containing randomly ordered files from ADS
.
Version History
Introduced in R2018b
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
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)