Learn How to Graph 3D in MATLAB

  • Context: MATLAB 
  • Thread starter Thread starter Dell
  • Start date Start date
  • Tags Tags
    3d Graphing Matlab
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 7K views
Dell
Messages
555
Reaction score
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
 
Physics news on Phys.org
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".