怎样用MATLAB画维维安尼体的形 求大牛·····

R=2;

a=linspace(-pi,pi,80);

r=linspace(0,R,10)';

x=0.5*r*(1+cos(a));

y=0.5*r*sin(a);

z=sqrt(R^2-x.*x-y.*y);

mesh(x,y,z)

colormap([0,0,1])

hold on;

mesh(x,y,-z)

colormap([0,0,1])

hold on;

x1=0.5*R*(1+cos(a));

y1=0.5*R*sin(a);

X1=[x1;x1];

Y1=[y1;y1];

z1=[-1;1]*sqrt(R^2-x1.*x1-y1.*y1);

mesh(X1,Y1,z1)