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

2 views (last 30 days)
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

Andrei Bobrov
Andrei Bobrov on 5 Sep 2011
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
mohammad
mohammad on 5 Sep 2011
thanks dear
by which command can stop tic-toc ?
Andrei Bobrov
Andrei Bobrov on 5 Sep 2011
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

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!