function []=code7;
% Draw a surface in cylindrical coordinates
% Draw z=Sin(t)Cos(r) or Sint(2t)Cos(r) .
minr=0; maxr=10; dr=0.05;
mint=0; maxt=2.01*pi; dt=0.05;
[r,t]=meshgrid(minr:dr:maxr,mint:dt:maxt);
z=sin(2*t).*cos(r);
[x,y,z]=pol2cart(t,r,z);  % Convert to rectangular coordinates

surf(x,y,z)
 colorbar 'v';
 shading interp;
 hold on;
 %colorbar v:
view(120,20);

% Draw a set of axes
xmax=max(max(x)); ymax=max(max(y)); zmax=max(max(z));  
line([0,xmax],[0,0],[0,0],'LineWidth',2,'Color','r');
line([0,0],[0,ymax],[0,0],'LineWidth',2,'Color','r');
line([0,0],[0,0],[0,zmax],'LineWidth',2,'Color','r');
text(xmax+0.1,0,0,'X','Color','r','FontSize',15);
text(0,ymax+0.1,0,'Y','Color','r','FontSize',15);
text(0,0,zmax+0.01,'Z','Color','r','FontSize',15);
xlabel('x'); ylabel('y'); zlabel('z');
title('Surface');
% --------------------------------------------------------
