Matlab command to open all files in a directory
Matlab command to open all files in a directory
(OP)
Is there a Matlab command that allows the user to choose a directory and can then open all the files in that directory automatically? or is there a way to do it using uigetfile?





RE: Matlab command to open all files in a directory
You could get the path of the directory 'my_dir' using uigetfile.
CODE
mydir = '\matlabfiles\myproject';
files = dir([my_dir '\*.mat']);
for count = 1:length(files)
load([mydir files(count)];
end
% might be "load([mydir files{count}]".
% I don't have Matlab on this computer to check if you need
% curly braces or round brackets.
M
--
Dr Michael F Platten