how to plot f(x)=1/2(x1^2+x2^2+x3^2)?
13 views (last 30 days)
Show older comments
I am new to MATLAB .how to plot f(x)=1/2*(x1^2+x2^2+x3^2). a function of 3 variables?. I have almost tries all options for plot.
0 Comments
Answers (1)
John D'Errico
on 21 Mar 2018
Edited: John D'Errico
on 21 Mar 2018
Computers have screens that are TWO dimensional. Your brain understands how to look at a picture. It can even understand a 3-d scene, either by stereo clues, or by inference, because you expect a scene has depth in it. So your brain can use clues from the scene to infer depth, thus lines that should be parallel that converge with distance. Sometimes rotating a 3-d plot can give you the hints your brain will need. But anyone who has ever looked at an Escher print will understand the difficulties, even for a 3-d scene.
So in general, your brain can visualize a 2 or 3 dimensional image.
You want to plot a FOUR dimensional thing. Thus z = f(x1,x2,x3).
Do you have a hyper-dimensional monitor? A holodeck perhaps? Mine is still at the shop, waiting for parts from StarFleet supply. They tell me it might take hundreds of years before those parts arrive.
Occasionally people try to use a kluge like Chernoff faces to visualize higher dimensional information.
Another tool is to use iso-surfaces, perhaps a decent solution here, like a contour plot in 3-d. In other cases, color can be used to visualize information in higher dimensions.
Finally, you can use animation, using time as a 4th dimension, so a shape that varies with time.
No matter what though, 4-d is hard to visualize, because your brain understands a 3-d world.
5 Comments
See Also
Categories
Find more on Lighting, Transparency, and Shading in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!