  n = 1;
  kplot = 0;

  for logn = 0 : 10

    a = rand ( n, n );

    tic;
    for k = 1 : n
      for j = 1 : n
        for i = 1 : n
         a(i,j) = min ( a(i,j), a(i,k) + a(k,j) );
        end
      end
    end
    t = toc;

    kplot = kplot + 1;
    xplot(kplot) = log ( n );
    yplot(kplot) = log ( t );
    n = n * 2;

  end
  plot ( xplot, yplot, 'r-*', 'LineWidth', 2, 'MarkerSize', 10 );

  grid on
  xlabel ( 'Number of vector entries' );
  ylabel ( 'TicToc Time in Seconds' );
  title ( 'Floyd computation time versus number of cities' );

   for k = 1 : kplot - 1
     slope =( yplot(k+1)-yplot(k) ) / ( xplot(k+1) - xplot(k) );
     fprintf ( 1, '%d  %f\n', k, slope );
   end
