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.

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 23 Jun. 2018

2 Stimmen

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 Kommentare

samira karimi
samira karimi am 23 Jun. 2018
Thank you so much. This is exactly what I have been looking for, for 3 whole days!
samira karimi
samira karimi am 23 Jun. 2018
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by