How to get 2D view of an ellipsoid?

9 次查看(过去 30 天)
Hello,
I have a plot of an ellipsoid obtained by :
>> [x, y, z] = ellipsoid(0,0,0,xr,yr,zr);
figure
surf(x, y, z)
axis equal
Now I need to obtain 3 plots showing x Vs y & x Vs z & y Vs z, so basically I'll get 3 2D plots each showing an ellipse. Is there any Matlab command that'll do that ? I'd really appreciate your help.
Thank you!

采纳的回答

Ced
Ced 2016-3-10
Hi
You could use the "view" function for that, which allows you to set the viewing angle (azimuth and elevation). Note that the angles are in degrees, not radians.
For the choices mentioned:
xr = 1;
yr = 2;
zr = 1.2;
[x, y, z] = ellipsoid(0,0,0,xr,yr,zr);
surf(x, y, z);
axis equal
% Now change the view
% X vs Y
view(0,90)
pause
% X vs Z
view(0,0)
pause
% Y vs Z
view(90,0)
Cheers

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Geographic Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by