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.

Antworten (1)

Mischa Kim
Mischa Kim am 20 Jan. 2014
Bearbeitet: Mischa Kim am 20 Jan. 2014

1 Stimme

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

2 Kommentare

Marcel
Marcel am 20 Jan. 2014
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Vector Fields finden Sie in Hilfe-Center und File Exchange

Produkte

Tags

Gefragt:

am 20 Jan. 2014

Kommentiert:

am 20 Jan. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by