Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Averaging the rows in a multidimensional array

Solved!
Go to solution

I have a file (file1.dat) that is created using the 'write to spreadsheet file vi', which writes the output of an photo-detector. The experiment has N trials. Each trial gives a 1D array of M number of data as a column. Once the experiment is complete, the file will contain N columns and M rows. How I can find the average of each row in labview ? The output (file 2.dat) should be a column of M elements, each element being the average of the N data contained in a row. Processing in excel or origin is not practicable. Usually, M>10000 and N>100. Can some one help ? For example:

 

file 1.dat:

A1   B1  C1

A2   B2  C2

A3   B3  C3

A4   B4  C4

 

File 2.dat should be:

(A1+B1+C1)/3

(A2+B2+C2)/3

(A3+B3+C3)/3

(A4+B4+C4)/3

 

Thanks !

 

0 Kudos
Message 1 of 3
(2,981 Views)
Solution
Accepted by topic author kumban

If all you've got in the file is data with no headers or footers, it should be pretty simple.  Look at this:

 

2d array avg.png

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 3
(2,973 Views)

it works well ! Thank you Kevin

0 Kudos
Message 3 of 3
(2,943 Views)