% Script File: MatBench
% 
% Compare different matrix multiplication methods.
  
  clc
  home
  disp(' n    Dot    Saxpy   MatVec  Outer   Direct')
  disp('--------------------------------------------')
  for n = [10 20 40 80]
     A = rand(n,n);
     B = rand(n,n);
	 
     tstart = clock;
     C = MatMatDot(A,B);
     t1 = etime(clock,tstart);

     tstart = clock;
     C = MatMatSax(A,B);
     t2 = etime(clock,tstart);

     tstart = clock;
     C = MatMatVec(A,B);
     t3 = etime(clock,tstart);

     tstart = clock;
     C = MatMatOuter(A,B);
     t4 = etime(clock,tstart);

     tstart = clock;
     C = A*B;
     t5 = etime(clock,tstart);
	 
	 disp(sprintf('%2.0f  %6.3f  %6.3f  %6.3f  %6.3f  %6.3f ',n,t1,t2,t3,t4,t5))
end 
