I have a loop that calculates the mean (m
), standard deviation (std
), and standard error (sem
) for multiple conditions. As each condition has its own m
, std
, and sem
and I would like to name my output accordingly (they should be in double format). For example: cond1_m
, cond1_std
, cond1_sem
, cond2_m
, cond2_std
, cond2_sem
etc.
This is what I tried:
cond={'cond1','cond2','cond3','cond4','cond5',...}
for a=1:length(cond)
[strcat(cond{a},'_m'),strcat(cond{a},'_std'),strcat(cond{a},'_sem')]=compute_stats(M(:,a));
end
Note: compute_stats
is the function that outputs m
, std
, and sem
. M
is the matrix containing my data. The issue is that the strcat
doesn't seem to work as a way of changing the name of my output. For iteration 1, for instance, instead of giving me cond1_m
, my output is a matrix named strcat.
Can anyone help?