试试这样行不行;
clear all;clc;
u=0:pi/40:3*pi;
x=(1+cos(u)).*cos(u);
y=(1+cos(u)).*sin(u);
z=sin(u);
plot3(x,y,z);grid on;