plotting a vector field

2 visualizaciones (últimos 30 días)
Franco
Franco el 20 de Mayo de 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.

Respuesta aceptada

Matt Fig
Matt Fig el 20 de Mayo de 2011
Put this command after the call to QUIVER3:
hold on

Más respuestas (0)

Categorías

Más información sobre Vector Fields en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by