% %draw Simple Cylinder r=1; % inner radius of the beaker r1=2; % outer radius of the beaker % R=[r r]; % x and y coordinate of the cylinder % N=100; % number of vertical lines on the surface % Z=10;% dont know % [X,Y,Z] = cylinder(R,N); % testsubject = surf(X,Y,Z); % set(testsubject,'FaceAlpha',0.2) % hold on; i=1; while i<=100 %getting random points thetas=2*180*rand(); z1=rand(); R1=r+(r1-r)*(rand())^.5; %creates random uniform distribution x1=R1*cosd(thetas); y1=R1*sind(thetas); i=i+1; plot (x1,y1,'.'); hold on axis([-3 3 -3 3]) end cylinder(1); % a cylinder with radius 1 colormap([1,1,1]); hold on daspect([1 1 1]) %streches the sphere axis equal; xlabel('x-axis') ylabel('y-axis') zlabel('z-axis') rotate3d on