From the course: Learning MATLAB

Unlock the full course today

Join today to access over 23,700 courses taught by industry experts.

Create a basic 3D plot

Create a basic 3D plot - MATLAB Tutorial

From the course: Learning MATLAB

Create a basic 3D plot

- [Instructor] In this video we are going to investigate three dimensional plots or 3D plots. There are a few commands in MATLAB that help us create 3D objects and plots such as surf, mesh, meshgrid, et cetera, which I encourage you to explore using the MATLAB help menu. Here there are a few examples of a sphere, pyramid, and cube that are built with some of these commands. However, I'm going to show you a command that creates a 3D object using the patch command. And we are going to look at the coordinates of points of a given object. The patch command uses the vertex point of the object to build all faces of the 3D model and plot it as a figure. So let's look at an example. We are going to have a triangular prism with two bases. The two bases are triangles with one side of six and the two sides of five, and the height is equal to five. I've chosen these values to make it easy to find the coordinates of the vertex…

Contents