oblate and prolate figs

3 ビュー (過去 30 日間)
Mushtaq Al-Jubbori
Mushtaq Al-Jubbori 2023 年 1 月 26 日
コメント済み: Mushtaq Al-Jubbori 2023 年 2 月 14 日
Please can you help me to plot oblate and prolate ( code of Matlap) as in image
and if you can writen code of x^2/a^2 +y^2/b^2=1, where a^2=5.5 and b^2=7.73
  3 件のコメント
Mushtaq Al-Jubbori
Mushtaq Al-Jubbori 2023 年 1 月 27 日
If you can provided me the code
Rik
Rik 2023 年 1 月 27 日
doc sphere

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

採用された回答

DGM
DGM 2023 年 1 月 27 日
See ellipsoid()
r = [1 1 2]; % radius [x y z]
c = [0 0 0]; % center [x y z]
npoints = 30;
% if no output arguments are requested, a surf plot is created
% otherwise, look at the documentation
ellipsoid(c(1),c(2),c(3),r(1),r(2),r(3),npoints);
colormap(parula)
axis equal
  7 件のコメント
DGM
DGM 2023 年 2 月 2 日
If all you need are 2D ellipses, then this simplifies.
% a and b are equal-length row vectors
a = linspace(2.7,2.3,4); % i'm just picking some numbers similar to the image
b = linspace(3.2,3.8,4);
npoints = 100; % pick a suitable number of points
th = linspace(0,2*pi,npoints);
x = a.*cos(th).';
y = b.*sin(th).';
hp = plot(x,y);
axis equal
grid on
leglabels = {'thing 1','thing 2','thing 3','thing 4'};
legend(hp,leglabels)
Mushtaq Al-Jubbori
Mushtaq Al-Jubbori 2023 年 2 月 14 日
very thanks

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by