Streamline plot not complete

10 ビュー (過去 30 日間)
Eddward
Eddward 2019 年 11 月 18 日
コメント済み: Eddward 2019 年 11 月 18 日
I have been trying to make this streamline plot, unfortunately I have not been able to make it complete. I have looked on different forum pages but was not able to find a solution.
My code:
clear, clc
Gamma=-4;
a=1;
b=1;
Q=1;
[x,y]=meshgrid(-1:0.05:4,-1:0.05:1);
u= (y./(2*pi.*(x.^2+y.^2)))...
+(((2*Q.*b)/((a^2)*pi.*Gamma))...
.*((2*y.*(x-1))./((x.^2+y.^2-2.*x+1).^2)));
v= -((x)./(2.*pi.*(x.^2+y.^2)))...
-(((2*Q*b)./((a^2)*pi.*Gamma))...
*(((x.^2-y.^2-2.*x+1)./((x.^2+y.^2-2.*x+1).^2))));
hold on , clf
figure(1)
quiver(x,y,u,v)
N = 15;
startx = max(x).*rand(N,1);
starty = max(y).*rand(N,1);
streamline(x,y,u,v,startx,starty)
startx2 = -max(x).*rand(N,1);
starty2 = -max(y).*rand(N,1);
streamline(x,y,u,v,startx2,starty2)
startx3 = rand(N,1);
starty3 = rand(N,1);
streamline(x,y,u,v,startx3,starty3)
hold off
2019-11-18 12_51_18-Figure 1.png

採用された回答

darova
darova 2019 年 11 月 18 日
Works ok for me
N = 15;
xx = linspace(min(x(:)),max(x(:)),10);
yy = linspace(min(y(:)),max(y(:)),10);
[startx,starty] = meshgrid(xx,yy);
streamline(x,y,u,v,startx,starty)
  1 件のコメント
Eddward
Eddward 2019 年 11 月 18 日
Thank you for your response, had to change 10 to 50 for my plot.
Thank you very much.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVolume Visualization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by