Effacer les filtres
Effacer les filtres

plotting a vector field

1 vue (au cours des 30 derniers jours)
Franco
Franco le 20 Mai 2011
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.

Réponse acceptée

Matt Fig
Matt Fig le 20 Mai 2011
Put this command after the call to QUIVER3:
hold on

Plus de réponses (0)

Catégories

En savoir plus sur Vector Fields dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by