function Ellipsoid

% http://geometrie.hs-nb.de/MATLAB-Programme/Ellipsoid.m   Bearbeitungsstand: 29.9.2004
% (C) Martin Nitschke, nitschke@hs-nb.de

close('all')
a=5;
b=4;
c=3;
[Lambda,Phi]=meshgrid(linspace(0,2*pi,360),linspace(-pi,pi,180));
[X,Y,Z]=sph2cart(Lambda,Phi,1);
surf(a*X,b*Y,c*Z,Phi)
cm=0.5+0.375*(cos(2*pi*[0:size(X,1)-1]/(size(X,1)-1))).^2;
colormap(repmat(cm',1,3));
shading('interp')
axis([-4 4 -3 3 -2 2]) 
axis('off')
print('-deps','Ellipsoid','-opengl')
