How to Make 3D Plots Using MATLAB
Part 1 of 3:
Constructing the Domain
- Open the command window. In the default layout this should appear automatically as the biggest window displayed.
- If the command window isn't present, select home in the upper left corner. Afterwards, select layout and then "Default".
- In the command window, define both of your x and y vectors.
- This is typically done in the form of x=[vector or function] and y=[vector or function]
- Remember to use the dot operator when multiplying or dividing vectors and matrices. Otherwise errors will occur.
Part 2 of 3:
Producing the Grid in the xy-Plane
- Define a relationship between x and y. In order to accomplish this, two commands must be used.
- The first is the mesh function. By using this, the result will be a wireframe mesh graph.
- The other is the surf function. When using surf, the result will be a 3-D surface plot.
- When using mesh, input meshgrid to the command window.
- The command will be formatted as follows: [xx,yy]=meshgrid(x,y).
- In the workspace window you will see that the variables xx and yy have been defined.
Part 3 of 3:
Defining "zz" and Plotting the Surface
- Define zz in terms of xx and yy because of its reliance on those sets of data.
- Use the relationship you know exists between x and y. This is likely to be a function or formula.
- e.g., zz=xx.^2-yy.^2
- Plot the surface using the surf command.
- From the z components in the matrix "zz", the surf command will create a 3-D shaded surface.
- This is the point in which you will relate xx, yy, and zz together.
- The actual command line will be in the format of surf(xx,yy,zz) .
- Watch for your new window to appear showing your 3-D plot.
- Customize as you'd like. There is a toolbar at the top of the window where the new plot has appeared. This toolbar contains many options and features that can be used to manipulate your 3-D plot.
- Some of these options include:
- Inserting a label for the x, y, or z axis
- Inserting a legend to help readers
- Rotating the plot in it's 3-D space
- Inserting a light source to show the effects of shadows
- A list of complex surface properties can be found at http://www.mathworks.com/help/matlab/examples/changing-surface-properties.html
- Some of these options include:
- Smooth the color map across the entire surface of the graph, if you'd like. This is done by using the command line shading interp.
4 ★ | 4 Vote
You should read it
- Color command in Windows
- Surface Pro 3 receives new updates, improves drivers for the Surface Pen
- How to add 'Open command window here as administrator' to the right-click menu on Windows 10
- How to use the command history function in Command Prompt
- Surface Book 3 officially launched, becoming the most powerful Surface
- Microsoft is developing a low-cost Surface computer running Windows 11 SE
- Microsoft: Surface Pro 3 sales exceeded expectations
- Microsoft launched the first ad clip of the Surface Pro 3
May be interested
- Instructions for making simple creams do not require an ice cream machinemake sure after watching the steps below, surely everyone will make a delicious ice cream for the whole family!
- How to make taut apple jam, delicious on Tet holidaywhen tet comes, it is also the time when the apple is in season, in addition to eating fresh and delicious apples, we can make our apples jam, sweet, sour, chewy to enjoy, treat friends and make gifts for all people.
- How to make money by Kwaifor those who are passionate about virtual life online, kwai will be a powerful assistant to help you quickly become famous and popular if you own funny, unique and lovely clips. but the better thing is that you can make money from kwai through the videos you have made and uploaded to kwai.
- How to make your own baby stickers on Microsoft Wordso a new school year is coming up with more preparation work, especially families with children who are studying in primary school. and parents can make cute, funny stickers according to their interests right on word tool.
- How to make coconut jam more natural colors without colorcolorful coconut jam is quite easy to make and used to decorate on the tray of confectionary on tet holiday, nothing is great. check out the five-color coconut jam recipe below and try it out.
- 17 jobs to help you stay home still make moneymaking money is the need and also the driving force for most of us. in addition to working directly at offices, you can also find a job at home while ensuring a regular monthly, even, income is much worse than the 8 hours available. face at work!
- Make 3D embossed cards for lovers on Valentine's Dayto make 3d embossed cards not too hard, you just need to be clever and a little creative to create a beautiful card for your lover on this valentine's day.
- How to make HD video with low capacity?you are looking to make hd quality videos for uploading to youtube or simply to save them to your computer later. however, you are afraid of the large amount of video will make the upload process slow or take up a lot of computer memory. therefore, we will show you how to make hd quality videos with low capacity in the article below. please consult.
- Summary of simple ways to make flan at homethe following article will summarize how to make simple flan cakes at home so that housewives can have the courage to show their talents in front of family, lovers, friends!
- 6 How to prepare delicious oats for the elderly and the sickthe following article, tipsmake.com would like to introduce you 6 ways to make delicious, nutritious bird's nest for the elderly and the sick.