MATLAB: Legend

def legend

What does string1, string2 and s fourth mean in explanation underneath
is it saved items? or something else?

Best Answer

when you do plot something you can specify your 'something' by the legend to know which plot corresponds to which function. try following: t=0:0.1:10;
y1=2*t;
y2=4*t;
plot(t,y1,t,y2);
legend('2*t','4*t');