Legend for variable number of plots
25 views (last 30 days)
Hi, I am plotting a variable 'y' whose size is 'm-by-n' against 'x' whose size is 'm-by-1'. So, I get 'n' plots on the current figure. Now, how can I write insert legend without knowing the value of n. I mean, how do I give dynamic input to legend function.
legend('Mode 1','Mode 2','Mode 3',...'Mode n')