automatic legend matlab code example
Example: automatic legend matlab
str = {strcat('z = ' , num2str(z))} % at the end of first loop, z being loop output
str = [str , strcat('z = ' , num2str(z))] % after 2nd loop
% plot your data
legend(str{:})
str = {strcat('z = ' , num2str(z))} % at the end of first loop, z being loop output
str = [str , strcat('z = ' , num2str(z))] % after 2nd loop
% plot your data
legend(str{:})