% % An extension of Example 9.3 % This shows how to get the quartiles using Tukey's method. % % Written by: % -- % John L. Weatherwax 2005-08-14 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- close all; drawnow; rehash; clc; clear; addpath( '../../Code/eda_data' ); addpath( '../../Code/eda_toolbox' ); addpath( '../Chapter1' ); addpath( '../../../CSHWM/Code/CSTool/' ); % <- for cshistden.m load geyser; n = length( geyser ); p = [ 0.25, 0.75 ]; for pi=1:length(p), fprintf( 'quantile ( %10.6f ) geyser = %10.6f\n', p(pi), quantile( geyser, p(pi) ) ); end figure; boxplot( geyser ); title( 'geyser data boxplot' ); % use the normal-reference rule to determine bin widths / number of bins: st = std(geyser); hNR = (24*(st^(3))*sqrt(pi) / n )^(1/3); N = ceil( (max(geyser)-min(geyser))/hNR ); figure; cshistden( geyser, N );