Quiver does not show any arrows

7 views (last 30 days)
Marcel
Marcel on 20 Jan 2014
Commented: Mischa Kim on 20 Jan 2014
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.

Answers (1)

Mischa Kim
Mischa Kim on 20 Jan 2014
Edited: Mischa Kim on 20 Jan 2014
You need to use
quiver(squeeze(uv(1,:,:)),squeeze(uv(2,:,:)))
to turn the 1x251x251 object uv(1,:,:) into a 251x251 matrix.
  2 Comments
Marcel
Marcel on 20 Jan 2014
Thank you, that solved the problem.
Mischa Kim
Mischa Kim on 20 Jan 2014
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.

Sign in to comment.

Categories

Find more on Vector Fields in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!