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?
Walter Roberson
Walter Roberson 2018 年 6 月 24 日
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 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by