12-17-2008 05:07 PM
Hi there ,
I have a vector which I decimate in three other vectors and I calculate the mean of each of them.
I was wondering if any one knows a less messier way of calculating those means. Imagine if a I decimate in 100 vectors, my program will be a mess.
Please have a look at my program.
Thank you
Solved! Go to Solution.
12-17-2008 05:25 PM - edited 12-17-2008 05:26 PM
12-17-2008 10:19 PM
Thank you altenbach for the help. Although I can not really understand how the decimation parts works, it just works fine.
I tested it using the attached program.
I think labview should have as many of sub vi like yours, especially the decimation one, which are of general form.
Imagine if i had to decimate the vector in 100 one, it would be a killer doing it my way.
I do not know where to suggest it, but is worth it.
12-18-2008 12:05 AM
vlonjati wrote:Although I can not really understand how the decimation parts works, it just works fine.
It is actually pretty simple. Let's assume we want to use a decimation factor of 3 and we have the following 1D array.
1 2 3 4 5 6 7 8 9 0 1 2 (each digit is an element)
Reshaping according to my code rearranges it into a 2D array:
1 2 3
4 5 6
7 8 9
0 1 2
We want to average each column, however autoindexing a 2D array on a loop boundary operates one row at a time.
Since we want to operate on columns, we need to transpose the array first.
The rest falls into place. 🙂