Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

HOW DO I PLOT THIS GRAPH

4 visualizzazioni (ultimi 30 giorni)
Zeng Zhi Tee
Zeng Zhi Tee il 2 Set 2018
Chiuso: MATLAB Answer Bot il 20 Ago 2021
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 Commenti
Zeng Zhi Tee
Zeng Zhi Tee il 9 Set 2018
Modificato: Walter Roberson il 9 Set 2018
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 il 9 Set 2018
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

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by