annotate general/numerical/quantile.m @ 6:0ce3c2070089

Removed duplicate code and fixed doc in timed_action.
author samer
date Mon, 14 Jan 2013 14:33:37 +0000
parents e44f49929e56
children
rev   line source
samer@4 1 function Y=quantile(Q,X)
samer@4 2 % quantile - compute quantiles of X
samer@4 3 %
samer@4 4 % quantile ::
samer@4 5 % [[L]->0--1] ~'the L quantiles to compute',
samer@4 6 % [[N,M]] ~'M columns of data'
samer@4 7 % -> [[L,M]] ~'the L quantiles for each of M columns'.
samer@4 8
samer@4 9 j=max(1,round(Q*size(X,1)));
samer@4 10 S=sort(X);
samer@4 11 Y=S(j,:);
samer@4 12
samer@4 13