randomly picking some files
Mostra commenti meno recenti
I want to pick some .wav files randomly from a certain directory without replacement or with no repititions .. how is that possible ? please help me in this regard
Risposta accettata
Più risposte (2)
Azzi Abdelmalek
il 10 Set 2013
your_folder='E:\matlab';
d=dir([your_folder '\*.wav']);
f={d.name};
n=numel(f);
idx=randi(numel(f));
file=f{idx}
f(idx)=[];
2 Commenti
jalal Ahmad
il 11 Set 2013
sabrina lenglet
il 14 Giu 2017
How can I play this sound or file.wav ? thanks
Walter Roberson
il 10 Set 2013
Yes. If your file names are in the cell array FileNames then
shuffleidx = randperm(length(fileNames));
for K = 1 : length(suffleidx)
thisfile = fileNames{shuffleidx(K)}
...
end
Categorie
Scopri di più su Audio I/O and Waveform Generation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!