plotting all indices in a for loop

1 visualizzazione (ultimi 30 giorni)
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?

Risposta accettata

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

Più risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by