how to add legend values automatically ?
109 views (last 30 days)
Show older comments
tomer polsky on 5 Apr 2019
Commented: Star Strider on 7 Apr 2019
how to add legend automatically : for exmaple this is my code . the question is how to write the legend without writting every time it manually ?
clc;clear all;close all
for i= [ 2 3 4 5 ]
Star Strider on 5 Apr 2019
Try this (considerably simplified version of your code):
i= [ 2 3 4 5 ];
The sprintfc function is undocumented although quite useful. You can also use the compose function to do the same thing here.
More Answers (0)
Find more on Legend in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!