MATLAB: Is it possible to do a for loop of this code

for loop

Hi,
sigma1cm0 = std(cm0_1); sigma1cmA = std(cmA_1);
sigma1cmq = std(cmq_1); sigma1cmE = std(cmE_1);
The size of cm0/A/q/E its all the same
>> size(cm0_1)
ans =
4 1
all 1 to 3 (three sets, from three different datas: cm0_1,cm0_2,cm0_3 and cmq_1,cmq_2 and so on ) and maybe each letter, as they have 'cm' in common? (0,A,q,E) Thanks

Best Answer

...if its possible to avoid the repetition and loop one line through all the four letters...
"Possible", yes, but "there be dragons" that way...
for why and alternatives. I think newer doc has a discussion under eval of the topic as well. For this case probably the alternative of dynamically-named structure is good choice.
Related Question