MATLAB: How to plot a quadratic equation

3d plotsplottingsurface

Hello everybody!
I've been struggling with this for a while and I don't know how to do that..
I would like to plot this: x²+y²+z²-2xy-4x+4y-1=0
thanks for your help!

Best Answer

Hello,
If you have a newer release of Matlab (I believe R2016b), you can use the new fimplicit3 function,
fimplicit3(@(x,y,z) x.^2+y.^2+z.^2-2*x.*y-4*x+4*y-1)
which will default to plotting on the interval [-5,5] (for all axes) but you can change this interval with the second input argument.
Hope this helps!