Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
How to select a bunch of files from a set of files?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (2)
Walter Roberson
il 21 Dic 2019
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 Commenti
Questa domanda è chiusa.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!