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!