[x,y,z]=sphere;mesh(x,y,z+9);hold on;% cylinder
r = 1.0;h = 9.0;m = h/r;[R,A] = meshgrid(linspace(0,r,11),linspace(0,2*pi,41));X = R .* cos(A);Y = R .* sin(A);Z = m*R;% Cone around the z-axis, point at the origin
mesh(X,Y,Z)hold onaxis equalphi = -pi/3;X1 = X*cos(phi) - Z*sin(phi);Y1 = Y;Z1 = X*sin(phi) + Z*cos(phi);[x,y,z]=sphere;mesh(x*0.6,y*0.6,z*0.6);
MATLAB: How to Generate 100 Random points inside the figure
100 random points
Best Answer