tic and toc to calculated the simulation time...but the this not the same everytime...

조회 수: 1 (최근 30일)
I am using a tic and toc command to calculate the simulation time of my matlab program...However, i found out that the time is different for every time...how to solve this or is there any other method that can be use to calculate the simulation time for matlab program?

답변 (1개)

Daniel Shub
Daniel Shub 2012년 5월 19일
The running time of your program is going to be slightly different every time because the OS does slightly different things while your program is running (it might check for viruses, download updates, refresh the screen, etc.). This means TIC/TOC should return different values.
  댓글 수: 2
Dennis  Ting
Dennis Ting 2012년 5월 19일
that mean it is impossible to get the same reading for the simulation time for each simulation?
John D'Errico
John D'Errico 2012년 5월 19일
Yes. Going off to use your web browser in the middle of a test can be a killer too. You can improve things by downloading timeit from the file exchange though. You will ALWAYS see some variability in the computed time.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Downloads에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by