LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

passing 3d array to mathscript node

Hi all,

 

I am dealing with mathscript nodes in LabVIEW and have some problems passing a 3D array (121*121*231) to the mathscript node.

I know the fact that mathscript nodes dont accept 3D arrays as inputs. So i am trying to create this 3D array inside of the mathscript node by accumulating 231 pages of 121*121 2D arrays.

But I am not able to perform this task and getting some error while accumulating 2D arrays inside mathscript node.

 

Passing3DarraytoMathscript.PNG

 

 

can anyone help me out to perform this sort little task of getting 3D array inside of the mathscript node?

 

Thanks in advance!

 

Rahul

Knorr-Bremse

Munich

0 Kudos
Message 1 of 9
(5,268 Views)
why you do not separate them by index array and use them in separately in mathscript nodes (3 separate 1d array)?
0 Kudos
Message 2 of 9
(5,234 Views)

Maybe because a 3D array is not 3 1D arrays?  Consider [[[1, 2,3,4],[5,6,7,8]],[[9,10,11,12],[13,14,15,16]],[[17,18,19,20],[21,22,23,24]]], a 3 by 2 by 4 3D array.  Which 3 1D arrays would you like to consider?

 

Maybe a better question is "Why use a Mathscript Node?"  If you know anything about array "arithmetic", I'd think you could do in LabVIEW (almost) anything you could do in Matlab.  What are you trying to compute?

 

Bob Schor 

Message 3 of 9
(5,217 Views)
if we regard 3d array like xyz data of 3d dimension points
Isnt true to convert them to three 1d array of x, y &z?
0 Kudos
Message 4 of 9
(5,203 Views)
ohh i realize my mistake and misconception
we have to regard 3d array like pages of matrixs
thank you Dennis
0 Kudos
Message 6 of 9
(5,176 Views)
That's what I'm trying to do Hatef, create a 3D array(121*121*231) inside the mathscript node by indexing the 231 pages of 121*121 2D arrays.
@bob : I need the 3D array inside mathscript node coz I have to to further processing on that array and take out suitable 2D array pages out of it and display that on the front panel, and Matlab code is ready for that. So I thought of just fetching this 3D array to this mathscript node.
Thanks
0 Kudos
Message 7 of 9
(5,158 Views)

labview have matlab scripted  nodes
I use it before it could comminute  with matlab 
did you try that ever  you can put 2d array inside this scrip 
so you by index array vi you can extract  page of 3d array and use it with that may be it work !?

0 Kudos
Message 8 of 9
(5,131 Views)

What is so difficult about using LabVIEW's Index Arrays to select 2D "pages" from a 3D Array?  Here I create my favorite 3D array, display it as a 3D array (you have to scroll through the pages), then "Slice and Dice" it to let you choose an individual Page (showing Rows and Columns), an individual Row (showing Pages and Columns), or an individual Column (showing Pages and Rows).  What could be simpler?  Each gives you a 2D "slice" through one of the three Dimensions ...

Slice and Dice.png

Bob Schor

Message 9 of 9
(5,114 Views)