% % epage 325 % % 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. % %----- clear all; close all; clc; addpath('../../Code/CSTool'); load iris; % consider the first two data columns: data=[setosa(:,1:2);versicolor(:,1:2);virginica(:,1:2)]; n=size(data,1); % use the computational statistics toolbox to create bivariate frequency polygon estimates: [fp,x,y] = csfreqpoly(data); title( sprintf('bivariate frequency polygon PDF estimate of iris features #%d and #%d',1,2) ); thePairs = combnk(1:4,2); for pi=1:size(thePairs,1), prs = thePairs(pi,:); fprintf('working on features #%d and #%d ...\n', prs(1), prs(2) ); ii=prs(1); jj=prs(2); data=[setosa(:,[ii,jj]);versicolor(:,[ii,jj]);virginica(:,[ii,jj])]; n=size(data,1); [fp,x,y] = csfreqpoly(data); xlabel( sprintf('feature #%d',ii) ); ylabel( sprintf('feature #%d',jj) ); figure; contour(x,y,fp); xlabel( sprintf('feature #%d',ii) ); ylabel( sprintf('feature #%d',jj) ); pause; close all; end