you can also use non-singular forms of tic and toc :
tStart=tic;
A = [2 1 3 ; 1 2 5 ;3 5 4 ]
[U,S,V] = svd(A)
tElapsed=toc(tStart);
This allows you to use more than one timer. (otherwise you need to ensure the exclusive use ticand tocfor one measurement)
source
share