FT_AMEDIAN

 FT_AMEDIAN()
 Find middle value in array, or average of two middle values

 Syntax

      FT_AMEDIAN( <aArray> [, <nStart> [, <nEnd> ] ] )
                 -> nMedian

 Arguments

     <aArray> is the array containing the elements to be averaged.

     <nStart> is the first array element to include,
     defaults to first element.

     <nEnd> is the last array element to include,
     defaults to last element.

 Returns

     The median average of the array elements

 Description

     This function sorts the elements of a numeric array and
     then returns the value in the middle element of the sorted
     array.  If there is no exact middle value, then it returns
     the average of the two middle values.  Half of the elements
     are > median and half are < median.  A median average may
     more reflect a more useful average when there are extreme
     values in the set.

 Examples

     FT_AMEDIAN( aArray )      // Return Median for entire array

     FT_AMEDIAN( aArray, 2)    // Return Median for elements from 2 to end

     FT_AMEDIAN( aArray, ,9)   // Return Median for 1st 9 elements

     FT_AMEDIAN( aArray,8,40 ) // Return Median for elements 8 to 40

 Source: AMEDIAN.PRG

 Author: Ralph Oliver,  TRANSCOM SYSTEMS

 

3 responses to “FT_AMEDIAN

  1. Pingback: FT Functions | Viva Clipper !

  2. Pingback: FT Array Functions | Viva Clipper !

  3. Pingback: NanForum Toolkit | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.