LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

bar3 plots using mathscript

Hi!

 

I am trying to implement a bar3 (matlab) plot using mathscript. Basically I four sensors which are placed in a 2x2 array format. I wish to plot their output is such a way that their position in graph looks likea their physical position. But, their individual response is shown as bar (whose height changes with the output from individual sensor). I could easily do this in matlab using command like:

 

 

%data allocation as per channel location 

a=rand(10,4);

for i=1:10

c(1,1)=a(i,1);

c(1,2)=a(i,2);

c(2,1)=a(i,3);

c(2,2)=a(i,4);

b=cat(3,b,c);

end

 

%obtain frames per iteration

for j=1:10

bar3(b(:,:,j));

M(j)=getframe(gcf,winsize);

end

 

I tried doing same in Labview using mathscript. But, neither I see any error nor I see an output. I would be grateful for any comment/help. Thanks in advance.

 

rsd

0 Kudos
Message 1 of 2
(6,114 Views)
Hello rsd,

I am curious why you didn't see any errors with this code.  What version of LabVIEW are you using?  Did you run it in the MathScript Window or the MathScript node?  Do you have the LabVIEW Control Design & Simulation module installed?

There are two problems with this code.  First, MathScript does not support 3D arrays.  Consequently, the cat command will return an error since you attempt to work in the 3rd dimension.  Second, MathScript does not support movie animations, so MathScript will report an unknown symbol error for the getframe command.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 2 of 2
(6,096 Views)