quiver3 in a loop

조회 수: 10 (최근 30일)
Oday Shahadh
Oday Shahadh 2020년 6월 20일
댓글: KSSV 2020년 6월 20일
hi
I have (bbhat ) size(150,3) and (vvhat) size(150,3)
both vectors have the same size
I tried this:
for ii = 1:length(bbhat);
quiver3(bbhat(ii,1),bbhat(ii,2),bbhat(ii,3),vvhat(ii,1),vvhat(ii,2),vvhat(ii:3),0.5);hold on
end
I got this error
Error using quiver3 (line 43)
V and W must be the same size.
pls help
  댓글 수: 1
Oday Shahadh
Oday Shahadh 2020년 6월 20일
size(bbhat)
ans =
105 3
>> size(vvhat)
ans =
105 3

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2020년 6월 20일
There is a typo error ..you have used vvhat(ii:3) instead of vvhat(ii,3)
for ii = 1:length(bbhat);
quiver3(bbhat(ii,1),bbhat(ii,2),bbhat(ii,3),vvhat(ii,1),vvhat(ii,2),vvhat(ii,3),0.5);hold on
end
Also note that you need not to use loop for this..you should plot all at once.
quiver3(bbhat(:,1),bbhat(:,2),bbhat(:,3),vvhat(:,1),vvhat(:,2),vvhat(:,3),0.5);hold on
  댓글 수: 2
Oday Shahadh
Oday Shahadh 2020년 6월 20일
thanks you are great
KSSV
KSSV 2020년 6월 20일
Thanks is accepting answer.:)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by