[num, txt, raw]=xlsread('pizzasize.xls');
pmans={'Dominos', 'EagleBoys'}; %manufacturers of pizza; 
                                %this is a cell array
                                
ndat=size(num, 1);      %number of data points
dsizes=zeros(ndat, 1);  %initialize data size
esizes=zeros(ndat, 1);
dp=1; ep=1;             %counter for each class

for i=1:ndat
    if strcmp(txt(i, 1), pmans{1})
        dsizes(dp)=num(i, 5);
        dp=dp+1;
    elseif strcmp(txt(i, 1), pmans{2})
        esizes(ep)=num(i, 5);
        ep=ep+1;
    end
end
esizes(ep:end) = [];            %remove unused space (all zero values)
dsizes(dp:end) = [];            

xmin = min([esizes; dsizes]);   %min pizza size of all
xmax = max([esizes; dsizes]);   %max pixxa size of all
set(0, 'DefaultAxesFontName', 'Times New Roman');
set(0, 'DefaultAxesFontSize', 18);

figure(2); hist(dsizes, 25); title(pmans{1}); %plot Dominos histo
axis([xmin xmax 0 30]); 
figure(3); hist(esizes, 25); title(pmans{2}); %plot EagleBoys histo
axis([xmin xmax 0 30]); %both windows are set with the same axis range for comparison
