LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview programming

I am trying to sort out the data of a 2-D arrary that consists of +ve,
0, -ve integers. I need to calculate the occurance of same data values.

For example, [1, 0, 10]
[-1, 1, -3]
[2, 3, 1]

Result: -3 (1 times)
-1 (1 times)
0 (1 times)
1 (2 times)
and so on.

Pls advise how can I use VIs to achieve.

Thanks in advance for yr help.

eric
0 Kudos
Message 1 of 2
(2,368 Views)
"Eric Lin" wrote:
>I am trying to sort out the data of a 2-D arrary that >consists of +ve,
0, -ve integers. I need to calculate >the occurance of same data values.
>
>For example,
>[1, 0, 10]
>[-1, 1, -3]
>[2, 3, 1]
>
>Result:
>-3 (1 times)
>-1 (1 times)
>and so on.
>
>Pls advise how can I use VIs to achieve.

Try transforming the 2D array to a 1D array, using the 'reshape array' function
from the array group. Then you can use the histogram functions to count the
different values, just like in ordinary 1D. As long as the positions are
unimportant, eveerything should be fine.

Maarten.
0 Kudos
Message 2 of 2
(2,368 Views)