Maptitude GISDK Help |
Computes the median of the elements of an array.
avg_value = Median(array data_values)
Argument |
Contents |
data_values |
An array of numbers |
A real number equal to the median of the elements of data_values.
The array must contain numbers only. Other types, including null, are not allowed.
If there is an odd number of array elements, Median() returns the middle number in sorted order.
If there is an even number of array elements, Median() returns the average of the middle numbers in sorted order.
x = Median({1,3,5}) |
// x = 3.0 |
y = Median({4,1,3,5}) |
// y = (3+4)/2 = 3.5 |
z = Median({5,5,3,1}) |
// z = (3+5)/2 = 4.0 |
Error Type |
Meaning |
Error |
The array contains values that are null or are not numbers |
Function |
Summary |
Returns the mean (average) of the elements of an array |
©2025 Caliper Corporation | www.caliper.com |