how to use Arrays for plotting curves in for loop
Ältere Kommentare anzeigen
Hi all,
I need some help here
I have to plot multiple curves on same graph for eg
t=0:.1:6
y1=sin(t)
y2=sin(2t)
y3=sin(3t)
.
.
.
and have to plot all this y1,y2,y3... w.r.t t on the same graph with different colors and linestyles
Since they are large in no i want to use an array for y1,y2,... and a for loop to define them and plot them all.
How can this be done????
Akzeptierte Antwort
Weitere Antworten (1)
Andrei Bobrov
am 15 Dez. 2013
t = (0:.1:6)';
y = sin(t*(1:3));
plot(t,y);
1 Kommentar
kiran
am 19 Dez. 2013
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!