Contents Previous Next Subchapters

Percentiles of Each Column
Syntax prctile(Xp)
See Also colrange , colmedian , colmean , sort

Description
Returns percentiles of the values in X. The value returned is a real or double-precision row vector with the same column dimension as X. The value p is a numeric scalar that specifies the percent value to calculate.

Example
     X = {1., 2, 3, 4, 5}
     X = X*X'
     print "X == ", X
     print "25th percentile == ", prctile(X, 25.0)
returns
     X ==  {
     [ 1 , 2 , 3 , 4 , 5 ]
     [ 2 , 4 , 6 , 8 , 10 ]
     [ 3 , 6 , 9 , 12 , 15 ]
     [ 4 , 8 , 12 , 16 , 20 ]
     [ 5 , 10 , 15 , 20 , 25 ]
     }
     25th percentile ==  [ 2 , 4 , 6 , 8 , 10 ] 
Continue the example by entering
     prctile(X, 75)
returns
     [ 4 , 8 , 12 , 16 , 20 ]