how to plot ellipsoid in 3d not in the center
1 次查看(过去 30 天)
显示 更早的评论
Dear all,
I want to plot ellipsoid in 3dim not in the origin, what I should use , mesh or surf or plot3.
regards
回答(1 个)
Youssef Khmou
2014-9-14
For surface representation, you can use meshgrid to generate the ellipsoid with parameterization :
a=5;
b=3;
c=1;
[u,v]=meshgrid(-pi/2:0.1:pi/2,linspace(-pi,pi,length(u)));
x=a*cos(u).*cos(v);
y=b*cos(u).*sin(v);
z=c*sin(u);
figure; surf(x,y,z);
title(' Ellipsoid');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/175640/image.bmp)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!