
How to remove the horizontal streamline when plotting contour using atan2? Streamline plotting help
2 ビュー (過去 30 日間)
古いコメントを表示
Hi. I have a streamline plot as follow:
[X,Y] = meshgrid (-2:0.01:2,-2:0.01:2);
Z =atan2(Y,X) +Y;
contour (X,Y,Z, 30);
However as you can see there exists that one one horizontal streamline in the middle from (-2,0) to (0,0) that shouldn't be there. Any ideas how i can remove it or what i should change?
I will greatly appreciate any help provided. Thank you!
0 件のコメント
回答 (1 件)
Massimo Zanetti
2016 年 10 月 27 日
編集済み: Massimo Zanetti
2016 年 10 月 27 日
Why they shouldn't be there? They SHOULD be there. This is the plot of the atan2 function:

That, you can easily get following the help page of atan2:
[X,Y] = meshgrid(-4:0.1:4,-4:0.1:4);
P = atan2(Y,X);
surf(X,Y,P);
view(45,45);
The function is discontinuous at Y=0 for all X<0.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Contour Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!