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.

participantsByDay(s)
function participantsByDay(s)
d = [s.date];
authorBins = floor(d(1)):1:ceil(d(end));
authorCount = zeros(size(authorBins));
for i = 1:length(authorBins)-1;
    thisBin = s((authorBins(i)<=[s.date]) & ([s.date] < authorBins(i+1)));
    authorCount(i) = length(unique({thisBin.author}));
end
nonempty = find(authorCount ~= 0);
range = min(nonempty):max(nonempty);

clf
drawnow
bar(authorBins(range)+(authorBins(2)-authorBins(1))/2,authorCount(range),'FaceColor','b','EdgeColor','b')
box on
datetick
hold on
set(gca,'GridLineStyle','-')
xlabel('day')
ylabel('unique participants')
title('Participation by Day')

Contact us at files@mathworks.com