Code covered by the BSD License  

Highlights from
MATLAB Contest Statistics

image thumbnail
from MATLAB Contest Statistics by Matthew Simoneau
The code used to generate the "Statistics" page for the MATLABĀ® Contest.

submissionsOverTime(s)
function submissionsOverTime(s)
f = s(~[s.passed]);
x1 = [s.date];
y1 = 1:length(x1);
x2 = [f.date];
y2 = 1:length(x2);
% Make sure the right edges match.
if (x1(end) > x2(end))
    x2(end+1) = x1(end);
    y2(end+1) = y2(end);
else
    x1(end+1) = x2(end);
    y1(end+1) = y1(end);
end

area(x1,y1,'facecolor',[.5 .8 .5]);
hold on
area(x2,y2,'facecolor',[.8 .5 .5]);
hold off

datetick
%set(gca,'XGrid','on','YGrid','on','GridLineStyle','-')
set(gcf,'Color','white')
xlabel('Time');
ylabel(sprintf('number of entries (%.0f total)',y1(end)+y2(end)))
title('Cumulative Totals of Entries Passing and Failing (stacked)')
legend({ ...
    sprintf('passing entries (%.0f total)',y1(end)-y2(end)), ...
    sprintf('failing entries (%.0f total)',y2(end))} ...
    ,2)
box on
axis tight

Contact us at files@mathworks.com