LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

no higher than 2-D arrays can be inputs, outputs?

hello,

i need to pass a 4-dimensional array into a mathscript node as well as receive an output that is 4-dimensional.  i came across a post where somebody speculated that the only way to input all of the information in a 3-D array is to reshape the array into a 2-D.  is this really the case?  can MathScript really not receive 3 or higher dimensional arrays?  ...seems kind of silly.

Message Edited by Alias77 on 07-06-2007 10:52 AM

0 Kudos
Message 1 of 7
(8,490 Views)
Hello,

Unfortunately, LabVIEW MathScript does not have support for higher than two-dimensional arrays at this time.  We are aware of the limitation and are considering implementing it for a future release.  It would help us to know your particular use case of 4-dimensional arrays in our planning to provide this support.  Can you elaborate on your code?

Reshaping the array to two dimensions before passing it to MathScript and reshaping it back afterwards will work if you will be performing only scalar operations.  LabVIEW itself will support higher-dimensional arrays.  If you write your algorithm in native LabVIEW code, you should be able to do what you wish.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 2 of 7
(8,481 Views)
thanks for the reply.  dangit.  that's too bad.  i currently use matlab to post-process EEG (electroencephalographic) signals, and these signals are recorded using a LabVIEW executable.   i'd like to be able to perform these post-precessing steps in real-time by inluding the post-processing steps into the LabVIEW code.  and, actually, i was mistaken.  i need to input a 2-D array (indices of time, and channel no.) and output a 3-D array (indices of time, channel no., frequency).  i have 160 channels, so i would think it would be messy to reshape the array into a 2-D (time, frequency). My subroutines involve multiple (13) bandpass filters, integrations, envelope detections, ect., which seem (to me, anyway) easier to execute using script.  would you happen to have any suggestions?

Message Edited by Alias77 on 07-06-2007 11:33 AM

Message Edited by Alias77 on 07-06-2007 11:34 AM

0 Kudos
Message 3 of 7
(8,481 Views)
Hello,

We're still a little unclear why you need a 3D output array.  Are you just computing the Fourier transform of your channel data?  Why not output a real 2D array of your modified (time, channel) data and a complex 2D array of your (channel, frequency) data?  Or are you doing something else such as a short-time Fourier transform?  What about wrapping a MathScript Node in a LabVIEW for loop?  This way, the node could output a 2D array each iteration and LabVIEW could build the data back into a 3D array.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 4 of 7
(8,462 Views)
thanks again for the response, and sorry for the delay.  after thinking about the script more closely, i won't necessarily have to input or output arrays of data whose dimension is greater than 2.  although, after testing my m-file script using MathScript, i've noticed that it can't even handle the processing of arrays whose dimension is greater than 2 (that are created and used entirely within the m-file).  is this true also? 
0 Kudos
Message 5 of 7
(8,418 Views)
Hello,

Yes, it is also true that LabVIEW MathScript cannot create or operate on arrays of dimension greater than 2, even within its own boundaries.

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

Hey guys, could you explain me a bit or point me somewhere I can find the information ?

I don't really get how you transform a 3D matrix in a 2D one inside labview.

In mathscript I would like to do this:

 

img = reshape(slope(m,round(y-z)-1:round(y+z)+1,round(x-z)-1:round(x+z)+1),[ones(1,-z),siz]); (for instance)

 

But this is a 3d reshape, so it's not allowed. DO you have an idea how I could do this ? Making sub matrix ? I am a bit lost.

 

Thanks !

0 Kudos
Message 7 of 7
(6,728 Views)