3d surface plot of an elliptic shape

3 ビュー (過去 30 日間)
Saim
Saim 2022 年 12 月 14 日
編集済み: John D'Errico 2022 年 12 月 14 日
I have the values of x y and z in vectors, z is found by a mathematical method. The values of x and y are based on an ellipse equation (which means I can't use linspace(min,max) on x and y because it takes points out of the elliptic boundary).
I have to do a 3d plot, can someone help?
  2 件のコメント
Fifteen12
Fifteen12 2022 年 12 月 14 日
Saim
Saim 2022 年 12 月 14 日
can't use it, value of x and y are also saved in a vector.

サインインしてコメントする。

回答 (1 件)

John D'Errico
John D'Errico 2022 年 12 月 14 日
編集済み: John D'Errico 2022 年 12 月 14 日
If all you want to do is plot the ellipsoid, then you are doing it the wrong way. Just use fimplicit3. You never need to compute x,y, and z at all. For example...
C = [1 2 3];
H = randn(3);H = H'*H; % just insures that H is SPD, so the result will indeed be an ellipse.
syms x y z
E = ([x,y,z] - C)*H*([x,y,z] - C).' - 1;
fimplicit3(E)
axis equal
So all you need to do is feed the defining equation to fimplicit3.

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by