From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Average Sub Arrays

Solved!
Go to solution

Hello,

 

I'm trying to have a vi that receives an array from file, then constructs sub arrays (according to  FPS/Average Array Every), then takes the mean, finds the difference from each data point, and counts the number of times where the difference is larger than the threshold. Please review the attached file--my block diagram.

At this point, the vi is running but the is a bug in the code which I can't find :-(.

When I run it on some sample data counter returns~350 where it suppose to be only 3.

I'll appreciate if you can take a look at it.

 

Thank you,

 

P.S..

I'll be happy to upload the vi and a sample data file if needed.

0 Kudos
Message 1 of 7
(3,282 Views)
Solution
Accepted by topic author simply_me

simply_me,

 

You take an array subset, get the mean that looks ok.  But then you figure out the difference between the mean and the entire array you started with instead of the subset you used to calculate the mean.  Am guessing you meant to do this.

 

Message 2 of 7
(3,236 Views)

Thanks Wayne. C, it's working great now!

0 Kudos
Message 3 of 7
(3,208 Views)

how would i do an average of an array from 

index 100 to 300?

 

 

if i have an array of 2000 indexes,

how can i get the average from 100-300?

 

in 

excel it would be

=avg(C100:C300)

 

 

Best regards,
Krispiekream
0 Kudos
Message 4 of 7
(2,841 Views)

You should really start a new thread instead of adding to an old thread that is already marked as solved!)

 

Use array subset, then take the mean of the subset.

Message 5 of 7
(2,823 Views)

haha. ok..i will do that next time.

i just thought i don't wanna borther more people.. 

i wanna make sure i search the forum for answers before i post my own post.

but thanks. 

 

Untitled.png

 

Best regards,
Krispiekream
0 Kudos
Message 6 of 7
(2,771 Views)

krispiekream wrote:

i just thought i don't wanna borther more people.. 


You ARE bothering more people by adding to an old thread, because some of the old participants might still subscribe to updates.

0 Kudos
Message 7 of 7
(2,761 Views)