LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can a mathscript node work on arrays?

Solved!
Go to solution

on the Labview help page entitled 'configuring the data type of script node terminals' there is a line which says "Because the MathScript Node behaves differently than the other script nodes, you cannot change the data type of input terminals. Instead, if you wire an unsupported data type to an input terminal on a MathScript Node, LabVIEW either converts the data type to a supported type or displays a broken wire. If LabVIEW converts the data type, a coercion dot appears on the terminal where the conversion takes place. After you wire an input to a MathScript Node, right-click the input terminal and select Show Data Type from the shortcut menu to see the data type of the input."

 

I don't quite get this.

I want to do maths on arrays / vectors using mathscript. This means I need input terminals to have an array data type.

EG say I have A = [ 1 2 3 4 5] (perhaps from an array of averaged data for 5 different channels) and let's say I want to do B = A.^2 (using matlab syntax)-- can I do this with a mathscript node?

If not, does that mean I cannot do any vector/array maths using mathscript nodes? given that the whole point of matlab is to work on vectors and matrices, if mathscript nodes cannot do this it too it would be a severe limitation.

 

Dave

0 Kudos
Message 1 of 2
(2,830 Views)
Solution
Accepted by topic author oilyfingers
Yes, you can use arrays in a MathScript Node. Just create an input on the node, give it a name, and wire an array value to this input.
Jarrod S.
National Instruments
0 Kudos
Message 2 of 2
(2,810 Views)