i want to draw a streamline at 45 degree.

2 ビュー (過去 30 日間)
jongil park
jongil park 2021 年 4 月 1 日
コメント済み: jongil park 2021 年 4 月 3 日
hello. i already plot the contour of stream function at a = 90 degree.
which like this.
[x,y]=meshgrid(0:0.1:1.0:0.1:1);
psi=y.*x;
figure;
contour(psi,100);
but, i just want to plot stream function at a = 45 degree, like image that i attached.
how should i do with matlab?
thank you.

採用された回答

darova
darova 2021 年 4 月 2 日
clc,clear
[t,r] = ndgrid(0:5:45,0:10); % create mesh in polar coordinates
[x,y] = pol2cart(t*pi/180,r); % convert to cartesian
z = x*0;
for i = 1:size(t,1)
z(i,:) = r(i,:).^2*sind(t(i)/t(end)*180);
end
contour(x,y,z)
  1 件のコメント
jongil park
jongil park 2021 年 4 月 3 日
oh god, thanks. i should try this.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by