Matrix multiplication

Jan 30, 2007: there is a new Matlab version which was installed Jan 11 2007. When I constructed the lab I used an older version (and I cannot use the lastest version on the teacher's side of the system). The new version is slower on these examples and does not give such a striking difference. It is more amusing to use an older version (such as Matlab 7.1).
Start, e.g. by typing /chalmers/sw/sup/matlab-7.1/bin/matlab


Run and explain the following:

A = randn(1000);

tic
  for k = 1:10
    C = A' * A;
  end
toc

tic
  for k = 1:10
    C = A * A';
  end
toc

tic
  for k = 1:10
    C = A * A;
  end
toc


Back