I want to make a "for loop" that uses some variables that looks like this: score1, score2, score3,…score21. My problem is that I cannot connect both string 'score' and the number (represented by 'i') as a whole string. the script is:
for i=1:21 [r c]=size(strcat('score', num2str(i))); for j=2:r strcat('cscore', num2str(i))(j-1)=strcat('score', num2str(i))(j)+strcat('score', num2str(i))(j-1); endend
after this, the value of this variable is a 'char' rather that a string.
thank you, Ziv.
Best Answer