How to print the time of a function in MATLAB
example:
%%%TAKE TIME
A = [2 1 3 ; 1 2 5 ;3 5 4 ]
[U,S,V] = svd(A)
%%%FINISH TIME
whats the syntax?
you can also use the nonsingleton 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 the use of more than one timer. (otherwise you have to ensure exclusive use of tic
and toc
for one measurement)
tic()
A = [2 1 3 ; 1 2 5 ;3 5 4 ]
[U,S,V] = svd(A)
toc()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With