Hi! I need to plot such an equation (function) in 3D space:
2*x^2+1.5*x*y-.8*x*z+2.5*y^2-3*y*z+z^2-0.35=0.
Everything that I have found, the function is
f(x,y,z)=... or f(x,y)=... .
I tried to use
v=2*x^2+1.5*x*y-.8*x*z+2.5*y^2-3*y*z+z^2;
scatter3(x(:), y(:), z(:), [], v(:));
and slice v=0.35, but turns out only x, y and z could be sliced.
Thank you very much in advance.

 Accepted Answer

syms x y z
f = 2*x^2+1.5*x*y-.8*x*z+2.5*y^2-3*y*z+z^2-0.35;
fimplicit3(f, [-2 2 -2 2 -2 2])

3 Comments

Thank you so much. This is exactly what I have been looking for, for 3 whole days!
Another question; is there any way to plot a volume of f<=0 instead of just f=0?
You can use
f = 2*x^2+1.5*x*y-.8*x*z+2.5*y^2-3*y*z+z^2-0.35 <= 0
with the fimplicit, but for reasons unknown you end up with a chunkier version of the same output when you would expect the same output instead, since <= 0 would just be the filled version of the shape.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!