%
%   Example for matlab-min vs. mymin
%
%   R. Unger 10/2012
%

clear;
close all;

% the dimensions to compute

s = [10 50 100 1000 10^4 10^5 10^6 10^7 10^8]


sl=length(s);

for i=1:sl
  N=s(i);
  fprintf('Do now size N=%d \n',N)
  x=rand(N,1);

  tic;
  m1=min(x);
  t_matlab(i) = toc;

  tic;
  m2=mymin(x);
  t_my(i) = toc;

end;

plot(s,t_matlab,s,t_my);
xlabel('vector size N ')
ylabel('computing time [s]')
title ('Matlab-min vs. mymin')
legend('matlab-min', 'mymin','Location', 'NorthWest')
