joining a character variable and a numerical variable to call a filename within a loop
Show older comments
how do i join the variable n to the variable filename to get the name of a real file that i want to call in a loop?
example
real files called: file 1, file 2 etc..
filename='file';
n=1:5;
for
some action filename + n;
end
many thanks
James
Accepted Answer
More Answers (2)
Jan
on 24 Feb 2011
2 votes
See also the FAQ:
It is alway a good idea to look for an answer there before asking here.
james
on 24 Feb 2011
0 votes
2 Comments
Robert Cumming
on 24 Feb 2011
why not? What error are you getting?
Post some code.
james
on 24 Feb 2011
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!