samer@4: function Y=quantile(Q,X) samer@4: % quantile - compute quantiles of X samer@4: % samer@4: % quantile :: samer@4: % [[L]->0--1] ~'the L quantiles to compute', samer@4: % [[N,M]] ~'M columns of data' samer@4: % -> [[L,M]] ~'the L quantiles for each of M columns'. samer@4: samer@4: j=max(1,round(Q*size(X,1))); samer@4: S=sort(X); samer@4: Y=S(j,:); samer@4: samer@4: