[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #29600] median() returns wrong result (sometim

From: Rik
Subject: [Octave-bug-tracker] [bug #29600] median() returns wrong result (sometimes)
Date: Mon, 19 Apr 2010 04:29:04 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100402 Ubuntu/9.10 (karmic) Firefox/3.5.9

Update of bug #29600 (project octave):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 


Follow-up Comment #1:

The definition of the median function depends on the number of elements in
the dataset.  If the number of elements is odd, then the median is just the
middle element of the dataset when they have been ordered from lowest to
highest.  If the number of elements is even then the median is equal to the
average (mean) of the two middle elements.  See
http://en.wikipedia.org/wiki/Median for further reference.

As examples,
median(1:5) = 3
median(1:4) = 2.5 [the average of the two middle elements 2 and 3]

This is not a bug.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]