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.
Mischa Kim
Mischa Kim 2014 年 1 月 20 日
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 ExchangeVector 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