biomedgirl
Bioengineer
- Aug 31, 2005
- 4
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?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
% load all *.mat files in the directory contained in the variable my_dir
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.