Or login with:
| template<class T> doublemedian( | int | n | |
| T* | data | )[inline] |
#include <codecogs/statistics/moments/median.h> #include <iostream> int main() { double x[6] = {0.2, 1.24, 0.5, 2.54, 2.3, 0.3}, y[6] = {1, 2, 3.2, 4, 5}, medx = Stats::Moments::median<double>(6, x), medy = Stats::Moments::median<double>(5, y); std::cout << "The median of the x array is: " << medx << std::endl; std::cout << "The median of the y array is: " << medy << std::endl; return 0; }
The median of the x array is: 0.87 The median of the y array is: 3.2
| n | the size of the population |
| data | the actual population given as an array |
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.
You must login to leave a messge