Drawing 3D Surfaces Of Mathematical Equations In MatLab® Easily

You can draw 3D graphs in Matlab® with conventional methods also. But here, we explain how to directly draw the 3D graph of an equation very easily with the ‘ezmesh()’ command in Matlab®. Take a look at the example below that is executed in the Matlab® command window. 

YOU CAN LEARN MatLab® IN MECHANICAL BASE; Click And Start To Learn MatLab®!

How To Use ‘ezmesh()’ Command In MatLab®?


If you execute this one line of code in Matlab®, you will obtain the 3D curve as you see below. Let’s explain how that ‘ezmesh()’ command works.

Output 3D surface of the code above.

Three elements are defined inside the ‘ezmesh()’ command. The first one is the equation that we want to obtain its 3D surface. You can write this with a random letter such as ‘x’ which is not needed to be defined in Matlab® as a variable. We think that it is the most easier side of this command over conventional methods to draw 3D graphs in MatLab®.

The second element inside the ‘ezmesh()’ command is the boundaries of the 3D surface in X and Y directions. In here, both boundaries are -100 to 100. 

The third element is the definition of the number of grids that will be plotted. In this example, the number is 50. 


As you see above, drawing 3D surfaces with the ‘ezmesh()’ command in Matlab® is very simple. 

Do not forget to leave your comments and questions below about the use of the ‘ezmesh()’ command in Matlab® below. 

If you want further coding examples about the ‘ezmesh()’ command in Matlab®, inform us in the comments.

This article is prepared for completely educative and informative purposes. Images used courtesy of Matlab®

Your precious feedbacks are very important to us.


Leave a Reply

Your email address will not be published. Required fields are marked *