Friday, May 14, 2010

matlab string and variable

command "eval", execute string with matlab expression

E.g. read the value of variable c0

i=0;
m=strcat('c',num2str(i)); %m is a string
eval(m); %print out the value of c0

No comments:

Post a Comment