![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/570964/image.png)
i want to draw a streamline at 45 degree.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/570064/image.png)
how should i do with matlab?
thank you.
0 commentaires
Réponse acceptée
darova
le 2 Avr 2021
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)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/570964/image.png)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Polar Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!