Contour graph boundary problem

3 views (last 30 days)
Cem Eren Aslan
Cem Eren Aslan on 31 May 2021
Commented: John D'Errico on 31 May 2021
X =linspace(-4.5,4.5);
Y =linspace(-4.5,4.5);
[X,Y] = meshgrid(X,Y);
Z= 3426.8/63.3+660*X*4/3.14/4.5^4+1700*Y*4/3.14/4.5^4;
contourf(X,Y,Z)
Output is numerically correct but the structure I analyzed is in the form of a circle but in the output graph it looks like a square.How can i fix it? How can i make it circle?
  1 Comment
John D'Errico
John D'Errico on 31 May 2021
Z is the equation of a PLANE. Z is LINEAR in the variables X and Y.
Then, you generated values in a square region. Plotting a planar surface over a square region in the (X,Y) plane, so Z(X,Y). The net result of what you did will be straight, parallel lines in a square region.
Is there any reason you would expect to see a circle arise from that in any sense? NO.
MATLAB cannot read your mind, nor can I. So what did you expect to see? Are you looking to plot contours of a planar surface over a circular region? Are you thinking you want to create a paraboloid of revolution, and then plot contours of that surfce, which would indeed be circular?

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by