09-09-2014 10:53 AM - edited 09-09-2014 10:54 AM
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')
09-10-2014 12:10 AM
Hi
Currently, MathScript can not generate multiple mesh objects in one plot.
09-11-2014 09:21 PM
If the objective is just show the cones on a 3D graph, you can try to use LabVIEW code directly to achieve this:
I post the code in attachment (LabVIEW 2013).
12-05-2021 06:39 AM
Dear Barp!
In your "Multiple cones.vi" all cones are of the same height. If the height of the cones is made different, then visually the cones become at different levels along the z-axis. Is it possible to program so that the bases of the cones of different heights are visually at the same level along the z-axis?