LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

averaging specific channels

I am trying to find an average for 18 channels starting from channel 9 up to and including channel 26. I have made the array but it is not working. please see the file attached.

 

Download All
0 Kudos
Message 1 of 11
(2,635 Views)

Well, the "array subset" node you're using is trying to get a 18x18 size array starting from index 9,9 and going to index 26,26.  

 

I'm guessing that's not what you want to do and you actually want an array sized 18x<sample count> starting from index 9,0.  

0 Kudos
Message 2 of 11
(2,610 Views)

How is it not working?  Give details.  For example, "It should give this answer but instead is giving this."

 

One thing I see is that you are taking a subset of a 2-D array starting from row 9 for 18 elements and column 9 for 18 elements. I think you'd want the entire column, or entire row, depending on which way the array is laid out.  It is also possible that the auto-indexing is indexing over the wrong dimension depending on how your array is laid out.  You may have already taken care of that with your Transpose Array, (or perhaps shouldn't have done that.)  You also have other code going from element 0,0 element 9,9, so likewise you are taking a corner of your array there.

 

Note, there is a function called Mean.VI that works on 1-D arrays.  You can put that in the For Loop and get rid of all the other code inside of it.

0 Kudos
Message 3 of 11
(2,608 Views)

Yes what I want is to find the average of an 18 channels starting from channel 9 and ending on 26 but not sure how to include it in my file. 

0 Kudos
Message 4 of 11
(2,578 Views)

By not working, I mean it doesn't get me a sum of the channels or average of the 18 channels i want to average starting from channel 9. if I start from channel 0 then it will return correct value but I can't start it from channel 9 and honestly not sure how to do it. 

0 Kudos
Message 5 of 11
(2,577 Views)

Learn LabVIEW.  Read the Help for functions you don't completely understand (such as Array Subset).  As you "learn LabVIEW", you might find some other functions that are helpful, such as Mean.vi.

 

Bob Schor

0 Kudos
Message 6 of 11
(2,573 Views)

fotowat@uwindsor.ca wrote:

By not working, I mean it doesn't get me a sum of the channels or average of the 18 channels i want to average starting from channel 9. if I start from channel 0 then it will return correct value but I can't start it from channel 9 and honestly not sure how to do it. 


Then attach your VI so we can see what you are doing wrong.

 

It is very difficult to help someone fix their car when they don't bring it to the shop to look at, or even tell us what bad sounds it is making.

0 Kudos
Message 7 of 11
(2,568 Views)

I have attached the file with my question but I also attached it here

Download All
0 Kudos
Message 8 of 11
(2,561 Views)

You're correct.  You did attach it before.  Now I remember looking at it.

 

But it seems you haven't tried any of the advice already given in this thread.

You talk about having problems with averaging an array.  You've been told twice about Mean.vi which works on 1-D arrays.  But you don't seem to have tried it.

 

You also don't seem to have fixed the problem with your array indexes!

0 Kudos
Message 9 of 11
(2,550 Views)

Thank you for the work on updating the file, however, this mean is still doesn't give me the correct average of the 18 channels for some reason

0 Kudos
Message 10 of 11
(2,481 Views)