Filter löschen
Filter löschen

Speed of a MATLAB code

1 Ansicht (letzte 30 Tage)
kartheek
kartheek am 28 Mai 2013
Hello
How to calculate the speed of execution of a MATLAB Code?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 28 Mai 2013
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 Kommentar
kartheek
kartheek am 28 Mai 2013
Thanq Roberson. It worked.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Iain
Iain am 28 Mai 2013
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 Kommentar
kartheek
kartheek am 28 Mai 2013
Thanq very much Lian. The technique worked and gave me my desired results.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by