diary 'slownorm.txt' 

version

for s = [50 100 150] 
  for i = 1:5
    A = sprand(s,s, 0.1 );

    tic(); n1 = norm(A);       t1 = toc();
    tic(); n2 = norm(full(A)); t2 = toc();

    printf("Norm diff: %6.4g, sparse time: %7.5f, full matrix time: %7.5f. Speed x: %f\n",
    n1-n2, t1, t2, t1/t2 );

  end
end

