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.

Réponses (1)

Mischa Kim
Mischa Kim le 20 Jan 2014
Modifié(e) : Mischa Kim le 20 Jan 2014

1 vote

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

2 commentaires

Marcel
Marcel le 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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Vector Fields dans Centre d'aide et File Exchange

Produits

Tags

Question posée :

le 20 Jan 2014

Commenté :

le 20 Jan 2014

Community Treasure Hunt

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

Start Hunting!

Translated by