Speed of a MATLAB code
Show older comments
Hello
How to calculate the speed of execution of a MATLAB Code?
Accepted Answer
More Answers (1)
Iain
on 28 May 2013
2 votes
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;
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!