plotting all indices in a for loop

2 Ansichten (letzte 30 Tage)
shobhit mehrotra
shobhit mehrotra am 4 Sep. 2014
Beantwortet: Star Strider am 4 Sep. 2014
i have this code
for n=1:35
A = sin(n*3)
B= cos(n^2)*3))
plot (A,B)
end
however when i plot it only plots the last point, how can i plot all of the points in the array?

Akzeptierte Antwort

Star Strider
Star Strider am 4 Sep. 2014
This should work:
for n=1:35
A(n) = sin(n*3)
B(n) = cos(n^2)*3))
plot (A,B)
end

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by