Learn How to Graph 3D in MATLAB

  • #1
590
0
i am learning MATLAB, but have not yet learned anything do do with graphing, but need a program that can plot x.y.z graphs for my calculus work,

can someone please help me plot 3d graphs on MATLAB, for example

z=x2+2x+y2-y

how can i input x,y,z so that MATLAB will give me the surface graph of this function
 
  • #2
Modify as you need:

[X Y] = meshgrid(linspace(-10,10));
z=X.^2+2.*X+Y.^2-Y;
mesh(X,Y,z)

Alternatively use "surf" instead of "mesh".
 

Suggested for: Learn How to Graph 3D in MATLAB

Replies
2
Views
964
Replies
4
Views
910
Replies
4
Views
485
Replies
1
Views
874
Replies
9
Views
1K
Replies
1
Views
664
Replies
5
Views
407
Replies
2
Views
1K
Replies
6
Views
728
Back
Top