LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting Multiple Mesh Objects

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')

0 Kudos
Message 1 of 4
(7,828 Views)

Hi

 

Currently, MathScript can not generate multiple mesh objects in one plot.

0 Kudos
Message 2 of 4
(7,813 Views)

If the objective is just show the cones on a 3D graph, you can try to use LabVIEW code directly to achieve this:

 

graph cones.JPG

 

I post the code in attachment (LabVIEW 2013).

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 3 of 4
(7,788 Views)

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?

0 Kudos
Message 4 of 4
(3,091 Views)