# how to plot f(x)=1/2(x​1^2+x2^2+x​3^2)?

7 views (last 30 days)
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.

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.
Karthi Ramachandran on 22 Mar 2018
Help if you can or kindly stop commenting. If you cant leave it, no need to show your expertise as its hurting the level of badges(am sorry to say this). there was no politeness in your answer. If am wrong for something I am very sorry.