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.

 채택된 답변

Walter Roberson
Walter Roberson 2018년 6월 23일

2 개 추천

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

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

질문:

2018년 6월 23일

댓글:

2018년 6월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by