randomly picking some files
古いコメントを表示
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
採用された回答
その他の回答 (2 件)
Azzi Abdelmalek
2013 年 9 月 10 日
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 件のコメント
jalal Ahmad
2013 年 9 月 11 日
sabrina lenglet
2017 年 6 月 14 日
How can I play this sound or file.wav ? thanks
Walter Roberson
2013 年 9 月 10 日
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
カテゴリ
ヘルプ センター および File Exchange で Audio I/O and Waveform Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!