plotting a vector field

1 次查看(过去 30 天)
Franco
Franco 2011-5-20
I am trying to plot a vector field using quiver, but rather that supply the arrays as a whole into the function, I would like to supply all of the variables one by one. Given:
x=[1,2,3]
y=[3,7,2]
z=[4,2,7]
u=[2,1,4]
v=[5,3,2]
w=[7,7,3]
for i = 1:3
for j = 1:3
for k = 1:3
quiver3(x(i),y(j),z(k),u(j),v(j),w(j));
end
end
end
as of now, this only gives me the vector of the values for the last loop, but what I would like is for it to plot all the vectors as it loops. Anyone know how to do that? Thanks in advance.

采纳的回答

Matt Fig
Matt Fig 2011-5-20
Put this command after the call to QUIVER3:
hold on

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Vector Fields 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by