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

 Akzeptierte Antwort

Naz
Naz am 13 Okt. 2011

0 Stimmen

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');

Weitere Antworten (2)

William
William am 13 Okt. 2011

0 Stimmen

They are the inputs you want to display in string format

2 Kommentare

William
William am 13 Okt. 2011
mystring = 'string1'
Tor Fredrik Hove
Tor Fredrik Hove am 13 Okt. 2011
I thought string was defined to be a many characters after each other?
Numbers or letters. Are mystring built in or is it defined and you name it afterwards? Here I have made a script which only says grid I called it gridit. ANd I tried to legend(gridit) while only having one figure but it did not work
http://bildr.no/view/999136

Melden Sie sich an, um zu kommentieren.

Mav Sam
Mav Sam am 19 Dez. 2017

0 Stimmen

hi, so I'm plotting functions that depend on a variable 'r' that perhaps changes 10 times, hence r is a variable and its elements can be identified as r(i) How do I include code in a legend argument, such that for 10 curves that are plotted representing 10 diff values of r, the legend displays the corresponding value of r that is being represented by the legend. Thanks for any help Thanks. Sam

Tags

Gefragt:

am 13 Okt. 2011

Beantwortet:

am 19 Dez. 2017

Community Treasure Hunt

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

Start Hunting!

Translated by