here is the code I tried before, however it does not work.
dirinfo = dir('C:\D\Test');dirinfo(~[dirinfo.isdir]) = [];%remove non-directories
subdirinfo = cell(length(dirinfo));for i = 1 : length(dirinfo) thisdir = dirinfo(i).name; subdirinfo{i} = dir(fullfile(thisdir,'test.m')); run(fullfile(thisdir,'test.m'));end
here is the error message I get:
Error using run (line 73).\test.m not found.Error in fish (line 7) run(fullfile(thisdir,'test.m'));
Best Answer