Quiver does not show any arrows

Hello all of you,
Iam trying to use a quiver plot for the first time.
I have a matrix uv(2x251x251) with an uv vector associated to x and y coordinates.
when i try to use
quiver(uv(1,:,:),uv(2,:,:))
i dont see anything. No points or Arrows.
When i try to plot just one vector for just one point with
quiver(uv(1,1,1),uv(2,1,1))
the Arrow shows up and i can see it.
my u and v values range from -1 to 1.
Iam realy new to Matlab and i dont get why i can see something when i plot one vector but not when i try to plot all of them.
Hope you can help me.

답변 (1개)

Mischa Kim
Mischa Kim 2014년 1월 20일
편집: Mischa Kim 2014년 1월 20일

1 개 추천

You need to use
quiver(squeeze(uv(1,:,:)),squeeze(uv(2,:,:)))
to turn the 1x251x251 object uv(1,:,:) into a 251x251 matrix.

댓글 수: 2

Marcel
Marcel 2014년 1월 20일
Thank you, that solved the problem.
As a side note, when using
quiver(uv(1,1,1),uv(2,1,1))
you create 1x1 matrices from uv by completely specifying the vector elements. That's why you see the arrow in this case.

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

카테고리

도움말 센터File Exchange에서 Vector Fields에 대해 자세히 알아보기

제품

태그

질문:

2014년 1월 20일

댓글:

2014년 1월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by