knowing how much time does running of a m-file take?

does anyone know how we can know time between from starting to finishing a program (how much time does it take from starting to finishing of a program that written in a m-file)?

 Accepted Answer

variant 1 (command window)
>>tic
varoutput = yourfun(varinput) % use your m-file yourfun.m
tim = toc
% tim - time use your programm from yourfun.m

4 Comments

thanks a lot
is it possible displays in hour:min:second format?
thanks dear
by which command can stop tic-toc ?
h=tim/3600
m = rem(h,1)*60
hms = [fix(h) fix(m) rem(m,1)*60]

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!