% % Written by: % -- % John L. Weatherwax 2008-02-20 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- n = 100; x = randn(1,n)*sqrt(2) + 10; % <- a normal distribution xs = sort(x); q0_5 = median(xs); xlt = xs( find(xs<=q0_5) ); q0_25 = median( xlt ); xgt = xs( find(xs>=q0_5) ); q0_75 = median( xgt ); fprintf('For %10d points the quantiles are approximated with (%10.5f,%10.5f,%10.5f)\n',n,q0_25,q0_5,q0_75);