![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/174260/image.png)
Drawing a 3-D graph, endpoint issues
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
verzhen Ligai
il 8 Mag 2016
Commentato: Star Strider
il 8 Mag 2016
Hello everyone,
I asked a question similar to this under the subject of linspace but I am re-posting it because this time I wanted to attach the photos. So that you can see clearly what my issue is.
The black/white graph(3dd.jpg) is what I am trying to draw and the graph in color(3d.jpg) is what I have drawn. I am not sure what I must modify to be able to successfully draw the black/white graph(3dd.jpg). I tried modifying the linspace values but I still couldn't achieve my goal.
Following is my code,
x=linspace(-2,2);
y=linspace(-2,2);
[X,Y] = meshgrid(x,y);
Z=(X.^2+3*Y.^2)*exp(-X.^2-Y.^2);
meshz(X,Y,Z)
Thank you very much.
0 Commenti
Risposta accettata
Star Strider
il 8 Mag 2016
Please clarify what you want.
This code:
x=linspace(-2,2);
y=linspace(-2,2);
[X,Y] = meshgrid(x,y);
Z=(X.^2+3*Y.^2).*exp(-X.^2-Y.^2);
meshz(X,Y,Z)
produces this plot:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/174260/image.png)
4 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Whos in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!