Example Code

Remove Max and Min then Take average of the remaining Data.

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

    Programming Language

  • LabVIEW G

Code and Documents

Attachment

Description

This example will Remove Max and Min then Take average of the remaining Data whatever measurement data you are pulling.

 

I might think this will be useful to those who will find this code:

 

Made with LabVIEW 9.0


syrpimp_0-1596097218329.png

 

 

How to Use

vi Attached, Enjoy!!!!

 

 

Related Links



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
crossrulz
Knight of NI Knight of NI
Knight of NI
on

@syrpimp wrote:

photo.jpg


1. No need for the Array Size to go into the FOR loop.  The autoindexing tunnel will tell it how many times to iterate.

2. No need for the Search 1D Array.  The Array Max & Min have outputs for the indexes of the max and min.  So just build those into an array, sort, and then use the loop with just Delete From Array.

3. If all you actually care about is the average, then just add all of your values, subtract the max and min, and then divide by (array size - 2).  No loops required then.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
syrpimp
Member
Member
on

TAHNKS 



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
syrpimp
Member
Member
on

 

syrpimp_0-1596096695043.png

 

 

 

 



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
crossrulz
Knight of NI Knight of NI
Knight of NI
on

@syrpimp wrote:
syrpimp_0-1596097218329.png


With the second option, you need to sort and reverse the index array, otherwise you will delete the wrong value if the max came before the min.

 

I'd like to see some benchmarks, but I would guess that option 3 would be the most efficient since it does not involve messing with the potentially large array.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
syrpimp
Member
Member
on



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
Contributors