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.

zigzag(p,orders)
function zigzag(p,orders)
% Plot entries.

isLeader = [p.isLeader];
mi = min([p(isLeader).rawScore]);
ma = max([p(isLeader).rawScore]);
y = normalize([p.rawScore],orders,mi,ma);
x = [p.cpu_time];

w = warning('off','MATLAB:Axes:NegativeDataInLogAxis');
plot(x,y,'Marker','x','MarkerSize',4,'LineStyle','none');
set(gca,'YScale','log')
set(gca,'xlim',[0 max(x(isLeader))])
set(gca,'ylim',[.9 10^orders*1.1])
warning(w)

% Add contour lines.
hold on
addContourLines(orders,mi,ma);

% Add leader path.
line(x(isLeader),y(isLeader),'Color','red','marker','.')
line(x(1),y(1),'Marker','o','Color','red')
text(x(1),y(1),'Sample  ','HorizontalAlignment','right','Rotation',-45)
lastLeader = find(isLeader,1,'last' );
line(x(lastLeader),y(lastLeader),'Marker','o','Color','red')
text(x(lastLeader),y(lastLeader),'Leader  ','HorizontalAlignment','right','Rotation',-45)

% Add labels.
ylabel('results (normalized log scale)')
xlabel('cpu time (seconds)')
title('Results vs. Time Tradeoff')

% for i = 1:length(p)
%     text(x(i),y(i),p(i).author,'horizontalalign','right')
% end

Contact us at files@mathworks.com