for loop for matlab files
Show older comments
Hi all, i have a group of M-files. they ara named in this manner:
%
M1.m
M2.m
.
.
.
how could i read these files inn a loop?
thak you all
Accepted Answer
More Answers (1)
Iain
on 2 Sep 2014
Ugh. The curse of eval strikes again.
That'll run them in a loop, but god help anyone trying to debug it.
for i = 1:m
eval(['M' num2str(i)])
end
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!