LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to wire input to "Standard deviation & Variance VI"

The data that is being read is an I16 file in a 2 dim array. I need to compute to mean and standard deviation for all the numbers in the array. If I wire this 2 dim array to the input of the "Standard Deviation and Variance" vi function I get a broken wire. I've tried numerous functions to convert the data into a format but I get incorrect answers. I believe I need to convert all the rows and comumns into a series of numbers. There are 128 rows and 128 columns all with different numbers.
0 Kudos
Message 1 of 5
(3,837 Views)
Are you inputing the complete 2D array? If so, you need to split your 2D array into 1D arrays, as this is the required input for the STD & Var vi.
0 Kudos
Message 2 of 5
(3,837 Views)
yes, this is a 2 dim array. But, I believe I still need to concatenate the numbers after I split the arrays dimensions off. I'm thinking of a FOR LOOP with the indexing disabled. Thank you.
0 Kudos
Message 3 of 5
(3,837 Views)
I'd suggest you use reshape array, to reshape the 2D array into a 1D array. See the attached LV 7 example.

I basically find the array size of the 2D array, multiply those dimensions sizes together and call reshape array. So, a 128x128 2D array becomes a 16K 1D array.

Brian
0 Kudos
Message 4 of 5
(3,837 Views)
Brian, Thanks a million. That did it. Although I didn't need the first Initialize array function. All I needed was to wire the I16 array into the Array Size then multiply it, then input that output to the Reshape Array dimension input and input the I16 array into the N-dim input. I was wiring the I16 array to the Reshape Array function and wiring a constant to the dim size input but was always getting wrong answers from Std Dev & Var VI. I was stumped as to how to convert that 2D array to the correct format. Now I know how to do it. Thanks again for your help.
0 Kudos
Message 5 of 5
(3,837 Views)