Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
How to select a bunch of files from a set of files?
조회 수: 1 (최근 30일)
이전 댓글 표시
Dear friends,
I have 50 *.std files and I want to select bunch of 5 files at a time for further process and so on up to 50 files. Kindly guide me in this regards....
Waiting for quick response.
Thank you
댓글 수: 0
답변 (2개)
Walter Roberson
2019년 12월 21일
projectdir = 'NameOfDirectoryFilesAreIn';
dinfo = dir( fullfile(projectdir, '*.std'));
filenames = fullfile( projectdir, {dinfo.name});
Nfiles = length(filenames);
randorder = randperm(Nfiles);
groups_of_5 = reshape(filenames(randorder), 5, []);
Now groups_of_5 is a cell array of character vectors with 5 rows and 10 columns. groups_of_5(:,K) is a cell array of the K'th group.
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!