Instability of computation time for a matlab code
이전 댓글 표시
Hi, I am testing a matlab code to evaluate computation time of my program. I used tic/toc as a measure for the elaspsed time, and operated for a total of 500 times. Below shows results of the testing, i.e., computation time (in sec) versus time of running. As can be seen in the plot, computation time before 230 times of running is quite stable, around 15 sec/run. However, in the later part of the testing, the computation time is quite unstable. Accounting all 500 times of running will give an average computation time of 24 sec/run, instead of 15 sec/run for 230 times of running.
I have some questions: 1). Which value should I used to evalute the computation speed of my code? 15 or 24 sec/run; 2). What is the reason for such variations in the later part of my program? Does this mean my program is unstable? or does all matlab programs behave the same way?
Thanks a lot! :)

답변 (1개)
Image Analyst
2018년 7월 17일
0 개 추천
Maybe a virus scan or backup was happening during the slow times, or a corporate download of new or additional software. These things happen all the time with me and affect all programs, not just MATLAB.
댓글 수: 3
Felix Wong
2018년 7월 17일
Image Analyst
2018년 7월 17일
Are you using Windows? Type control-shift-Esc to bring up the task list and see how much CPU, disk, or internet is being used and by what programs. In Windows 10 look at the performance tab to see time plots of them all. Windows Superfetch process is often a guilty party - just Google it.
Felix Wong
2018년 7월 19일
카테고리
도움말 센터 및 File Exchange에서 Software Development에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!