plotting all indices in a for loop

2 次查看(过去 30 天)
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?

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by