Streamline plot not complete
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponse acceptée
darova
le 18 Nov 2019
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)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Volume Visualization dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!