Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

HOW DO I PLOT THIS GRAPH

조회 수: 4 (최근 30일)
Zeng Zhi Tee
Zeng Zhi Tee 2018년 9월 2일
마감: MATLAB Answer Bot 2021년 8월 20일
Create a surface plot of the following function: Z = (4x^2+y^2+x-1)e^(-x^2-y^2)
the function z has 2 maximum points and 1 minimum point. Make sure your graph shows these 3 points clearly.
  댓글 수: 8
Zeng Zhi Tee
Zeng Zhi Tee 2018년 9월 9일
편집: Walter Roberson 2018년 9월 9일
This Correct?
[x,y]=meshgrid(-2:0.1:2,0:1);
z = (4.*x.^2 + y.^2 + x - 1).*exp((-x.^2) - (y.^2));
surf(x,y,z)
Walter Roberson
Walter Roberson 2018년 9월 9일
That looks okay.
I tend to suggest
surf(x, y, z, 'edgecolor', 'none')
to prevent the black edges from being drawn. The black edges are constant thickness, and can easily hide the graph itself when you plot more densely.
Notice by the way that you are only using two distinct points in y, since 0:1 is the same as [0 1] . Perhaps you were thinking of something like 0:.1:1

답변 (0개)

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by