Learn How to Graph 3D in MATLAB

  • Context: MATLAB 
  • Thread starter Thread starter Dell
  • Start date Start date
  • Tags Tags
    3d Graphing Matlab
Click For Summary
SUMMARY

This discussion focuses on plotting 3D graphs in MATLAB, specifically using the function z = x^2 + 2x + y^2 - y. The provided code utilizes the meshgrid function to create a grid of x and y values, followed by calculating the corresponding z values. Users can visualize the surface graph using either the mesh or surf functions. The example demonstrates how to effectively input and manipulate variables in MATLAB for 3D graphing.

PREREQUISITES
  • Familiarity with MATLAB programming environment
  • Understanding of 3D graphing concepts
  • Knowledge of mathematical functions and surface equations
  • Basic skills in using meshgrid and plotting functions in MATLAB
NEXT STEPS
  • Explore MATLAB's meshgrid function for creating coordinate grids
  • Learn how to use the surf function for enhanced surface plotting
  • Investigate MATLAB's plotting customization options for 3D graphs
  • Study advanced surface equations and their graphical representations in MATLAB
USEFUL FOR

Students, educators, and professionals in mathematics or engineering fields who require visualization of 3D functions using MATLAB.

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".
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K