Hello,
I am new to mathscript so this might be a really simple problem. I am trying to plot multiple cones on a single graph similar to the attached picture. I can plot single cones, however I cannot seem to figure out how to mesh seperate cones at the same time. Any help is appreciated!
Thanks, Trevor
CODE:
r=linspace(0,2,20);
theta=linspace(0,2*pi,40);
[r,theta]=meshgrid(r,theta);
%cone1
x=r.*cos(theta);
y=r.*sin(theta);
z=r;
c1=[x,y,z];
%cone2
x2=1+r.*cos(theta);
y2=3+r.*sin(theta);
z2=r;
c2=[x2,y2,z2];
%cone3
x3=3+r.*cos(theta);
y3=2+r.*sin(theta);
z3=r;
c3=[x3,y3,z3];
%mesh plot
mesh(c1,c2,c3)
%labels and titles
xlabel('x-axis')
ylabel('y-axis')
zlabel('z-axis')