time is 0.000304 seconds.
</pre><p>Let's try it without the conversion to see if we can notice the difference in speed. On my 2GHz laptop, this takes 0.001392
            seconds.
         </p><pre class="codeinput">D2 = zeros(n,n);
tic
<span class="keyword">for</span> i=1:n
    D2(i,:) = dijkstra(A,i);
<span class="keyword">end</span>
toc
</pre><pre class="codeoutput">Elapsed time is 0.000541 seconds.
</pre><p>And just to check, let's make sure the output is the same.</p><pre class="codeinput">isequal(D,D2