Hello All,
Can I plot y- velocity component in matlab I I have u,v and mesh? How?
Yashika

 採用された回答

KSSV
KSSV 2020 年 8 月 22 日

0 投票

5 件のコメント

Yashika
Yashika 2020 年 8 月 22 日
Hello,
Thank you but, I already read it, and it only said how to plot net velocity vectors using its component u and v. I want to plot only one out of it, x or y-velocity component. Either horizontal or vertical velocity conponents?
Yashika
KSSV
KSSV 2020 年 8 月 22 日
You can plot only one component as a colormap.....read about pcolor.
Yashika
Yashika 2020 年 8 月 22 日
Hello,
Thank you for the response, I read about pcolor and if I am not wrong, let (X,Y,V) are 3d matrix where X,Y is grid and V is magnitude of any quantity. Now, it appears pcolor plots as a surface of magnitude of that quantity.
All I want is arrows plot pointing in y-direction (as I am using only one directional component) with change in size with respect to its magnitude. Is this posible. If yes, kindly give some steps.
Yashika
KSSV
KSSV 2020 年 8 月 22 日
For that you can make one zero matrix of same size as X/Y/u/v and use quiver.
Let X , Y, u, v be your matrices.
O = zeros(size(X)) ;
% x-components
figure
quiver(X,Y,u,O) ;
% y-components
figure
quiver(X,Y,O,v)
Yashika
Yashika 2020 年 8 月 22 日
Thank you so much for the trick.

サインインしてコメントする。

その他の回答 (1 件)

Yashika
Yashika 2020 年 8 月 25 日

0 投票

Hello KSSV,
I have one more question, how do I plot velocity interface on the top of quiver? I tried for contour but it say I need to have square matrix for the same. I have columns for xdata, ydata, Vx and Vy. I am attaching picture for the referance. I need to plot black line on each set of blue quivers out off this. I tried plot(x,Vx) it didn't plot single black curve for single set of blue arrow.
Yashika

1 件のコメント

KSSV
KSSV 2020 年 8 月 25 日
n = 10 ;
x = zeros(n,1) ;
y = (1:n)' ;
u = rand(n,1) ;
v = zeros(n,1) ;
h = quiver(x,y,u,v,'scale',0) ;
hold on
plot(u,y,'b')
You need to play around with scale.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeVector Fields についてさらに検索

質問済み:

2020 年 8 月 22 日

コメント済み:

2020 年 8 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by