annotate general/numerical/quantile.m @ 4:e44f49929e56

Adding reorganised general toolbox, now in several subdirectories.
author samer
date Sat, 12 Jan 2013 19:21:22 +0000
parents
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