% Script: Bench2
% How long does it take to execute (nxn matrix)*(nxn matrix)?
t = [];
nValues = 20:20:2000;
for n = nValues
A = randn(n,n);
B = randn(n,n);
nRepeat = ceil(10^7/n^3);
tic
for k=1:nRepeat
C = A*B;
end
tau = toc;
t = [t tau/nRepeat];
end
semilogy(nValues,t)
ylabel('Time','fontsize',18)
xlabel('n','fontsize',18)
title('(nxn matrix)*(nxn matrix)','fontsize',20)
set(gca,'fontsize',16)
shg