07-10-2009 11:30 AM
I am continuous taking 10 samples of voltage every second and therefore the output (Y) every second is an array of one column and 10 rows. How do I create loop that will average the rows of each sample taken. For example, after 8 seconds I will have 8 arrays--from these array I want to average the 8 values in the 1st row of each array. Ultimately I want to ouput a 10 row array where each row is a mean value.
I'm new at programming and Labview so thanks in advance!
07-10-2009 11:45 AM - edited 07-10-2009 11:48 AM
Just sum the size=10 arrays in a shift register and divide by the number of iterations for display.
Here's an example:
07-10-2009 12:08 PM
07-10-2009 01:32 PM - edited 07-10-2009 01:33 PM
1D arrays in LabVIEW are just that. Unlike some other programming languages, there is no such thing as a "row" or "column" 1D array.
Even if you have a 2D 1xN or Nx1 array, the shift register would just accumulate a 2D array, and it would keep adding to it, while keeping the dimension the same. (The add operates element wise).
07-10-2009 02:03 PM
Sure, I've uploaded the code I have so far (still a work in progress..). I added in the shift register--is this the correct way that I want to this?
07-10-2009 03:04 PM - edited 07-10-2009 03:07 PM
For your code, you have a 1D array, so why would you built it into a 2D array. Makes no sense. 😉
Here's a quick draft on how to average your Y array. Use the while loop for the shift register.