matlab create variable name code example Example: eval matlab variable name for i=1:3 eval(['A' num2str(i) '= i']) end