I name variables dynamically in loop within a function:
for l=1:max(uv)label=cell(total_images,4);tempname=strcat('label',num2str(l));renvar('label', tempname()); end
so, I get variables label1, label2, label3,… I must assign values to them afterwards but since I do not know how many variables will be created because of max(uv) I have to obtain variable names on the left dynamically e.g. labelX{1,1}=imgtemp{1,1}; X should be dynamically assigned. I tried with "assignin" and "eval" without success.
any help?
Best Answer