필터 지우기
필터 지우기

Speed of a MATLAB code

조회 수: 1 (최근 30일)
kartheek
kartheek 2013년 5월 28일
Hello
How to calculate the speed of execution of a MATLAB Code?

채택된 답변

Walter Roberson
Walter Roberson 2013년 5월 28일
If you want to time with specific inputs, on your system, as currently configured, with the current load, then you can use http://www.mathworks.com/matlabcentral/fileexchange/18798-timeit-benchmarking-function
If you are trying to do an analysis of how the time varies with the size of the inputs, then in the general case you cannot do that. "Order analysis" needs to be done algebraically and through use of theorems.
  댓글 수: 1
kartheek
kartheek 2013년 5월 28일
Thanq Roberson. It worked.

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

추가 답변 (1개)

Iain
Iain 2013년 5월 28일
You can measure the time taken to execute a chunk of code using "now", or tic and toc,
tic;
codegoeshere;
toc % prints the time taken to screen.
logtime(1) = now;
code_segment
logtime(2) = now;
code_segment
...
logtime(n) = now;
  댓글 수: 1
kartheek
kartheek 2013년 5월 28일
Thanq very much Lian. The technique worked and gave me my desired results.

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

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by