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