Hi!
I would like to dynamically assign names for tables, but I get an error – 'Index exceeds matrix dimensions.' Real example is somewhat more complex, but the core idea is here, in a minimal example:
T = table(['M';'F';'M'],[45;32;34],... {'NY';'CA';'MA'},logical([1;0;0]),... 'VariableNames',{'Gender' 'Age' 'State' 'Vote'});for i=1:3s = ['A_',num2str(i),'= T'];eval(s); end
Does anyone have an idea where this error comes from and how to overcome it?
Thanks!
Best Answer