u1=linspace(0,2*pi,51); v1=linspace(pi/4,2*pi-pi/4,21);
[u,v]=meshgrid(u1,v1);
r0=4; r1=1;

x=cos(u).*(r0+r1*cos(v));
y=sin(u).*(r0+r1*cos(v));
z=r1*sin(v);

mesh(x,y,z)