I'd like to draw a monkey saddle surface using matlab. But how do I plot a function of several variables in matlab? I never did that before. I can define $x$ and $y$ as two vectors and then according to wikipedia the monkey saddle equation is $x^3-3xy^2$ so all I wanna do is plot that function? Are there any more monkey saddle surfaces that might be nicer than this one?
Drawing a monkey saddle surface in matlab?
0
$\begingroup$
matlab
-
0[Searching the docs is always a good idea.](http://www.mathworks.com/help/techdoc/ref/surf.html) – 2012-08-07
1 Answers
1
The easiest way is to use the surf
command:
x = min_x:step:max_x; y = min_y:step:max_y; [X,Y] = meshgrid(x,y); Z = X.^3-3*X.*Y.^2 surf(X,Y,Z);
should work. I don't have my MATLAB install on this computer, so I cannot verify.
-
0@RodyOldenhuis Thanks for the verification :) – 2012-08-07