Mesh Plot
古いコメントを表示
I am attempting to plot the equation X^2 + 4*Y^2 < 1, using the mesh function. I currently have the code
[X,Y] = meshgrid(-1:.25:1);
Z = ((X.^2 + 4 * Y.^2) );
mesh(X,Y,Z)
However, this does not follow the requirement of Z < 1. How would I accomplish this?
回答 (1 件)
the cyclist
2011 年 8 月 2 日
I don't understand why you expect Z to be less than 1, since your definition of Z clearly has a maximum of 5.
However if you only want to plot values of Z that are less than 1, then you could substitute "NaN" where Z>=1, like this:
Z(Z>1) = NaN
and then do your mesh plot.
8 件のコメント
Sean de Wolski
2011 年 8 月 2 日
z(z>=1)=nan
Tyler
2011 年 8 月 2 日
Sean de Wolski
2011 年 8 月 2 日
Perhaps you wanted
Z(Z>1) = 1;
so that it shows as one instead of blank?
the cyclist
2011 年 8 月 2 日
Well, the equation is what it is. Maybe if you plotted a finer mesh it would be better. Also, consider using the view() command to change the perspective.
Tyler
2011 年 8 月 2 日
the cyclist
2011 年 8 月 2 日
Also, the "4" in your equation is definitely going to mean that the shape is not very symmetrical between X and Y. Is that 4 really supposed to be there?
the cyclist
2011 年 8 月 2 日
Sorry! I made a typo of "finger mesh" instead of "finer mesh". I corrected it.
Sean de Wolski
2011 年 8 月 2 日
http://www.mathworks.com/matlabcentral/fileexchange/16728-fingerprint-application
finger meshing!
カテゴリ
ヘルプ センター および File Exchange で Surface and Mesh Plots についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!