How can I plot Streamline from a stream function?

Hello,
I have a stream function psi = 1.2X^2 + y^2. I have to plot streamline. How can I plot it by using MATLAB?
Thank you.

 採用された回答

Cris LaPierre
Cris LaPierre 2021 年 4 月 2 日

0 投票

10 件のコメント

Alpha Boy
Alpha Boy 2021 年 4 月 2 日
Thank you for your reply. I have tried it but it is not working for the above function. :(
Cris LaPierre
Cris LaPierre 2021 年 4 月 2 日
We could probably be of more help if you showed us what you have tried. At a minimum, copy.paste the code as well as any error message it is creating (all the red text).
Alpha Boy
Alpha Boy 2021 年 4 月 2 日
[x,y] = meshgrid(-3:.5:3,-3:.5:3);
u = 2*y;
v = -2.4*x;
figure
quiver(x,y,u,v)
startx = -3:0.5:3;
starty = ones(size(startx));
streamline(x,y,u,v,startx,starty)
Alpha Boy
Alpha Boy 2021 年 4 月 2 日
Alpha Boy
Alpha Boy 2021 年 4 月 2 日
[x,y] = meshgrid(-3:.5:3,-3:.5:3);
u = x;
v = -y;
figure
quiver(x,y,u,v)
startx = -3:0.5:3;
starty = ones(size(startx));
streamline(x,y,u,v,startx,starty)
Cris LaPierre
Cris LaPierre 2021 年 4 月 2 日
Looks like you got it working. Do you still have a question?
Alpha Boy
Alpha Boy 2021 年 4 月 2 日
How can I remove vector field from this plot? Want to plot only streamline.
Cris LaPierre
Cris LaPierre 2021 年 4 月 2 日
Don't include the code that creates them (quiver)
Alpha Boy
Alpha Boy 2021 年 4 月 2 日
[x,y] = meshgrid(-3:.5:3,-3:.5:3);
u = x;
v = -y;
figure
startx = -3:0.5:3;
starty = ones(size(startx));
streamline(x,y,u,v,startx,starty)
Alpha Boy
Alpha Boy 2021 年 4 月 2 日
Thank you

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

その他の回答 (1 件)

vishal
vishal 2025 年 4 月 15 日

0 投票

U=Kx V=-Ky

カテゴリ

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

質問済み:

2021 年 4 月 1 日

コメント済み:

2025 年 4 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by