u = linspace(0,2*pi,50);
v = linspace(0,2*pi,50);
[u,v]=meshgrid(u,v);
f=5+cos(u);
g=sin(u);
X = f.*cos(v);
Y = f.*sin(v);
Z = g; 
surf(X,Y,Z)
axis equal