multiple legend not showing in plot

1 view (last 30 days)
Ham Man
Ham Man on 8 Jul 2022
Commented: Ham Man on 10 Jul 2022
I have 5 plots and try to show the legend using handle.
h= [plot1(1);plot2(2);plot3(3);plot4(4);plot5(5)];
legend(h,'pln1','pln2','pln3','pln4','pln5');
But I get this error:
Index exceeds the number of array elements (1).
I appreciate any help!
  4 Comments
Ham Man
Ham Man on 10 Jul 2022
Great Karim,Many thanks, it works

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!