How to check which function is the slowest one?

9 visualizzazioni (ultimi 30 giorni)
AlonOz
AlonOz il 21 Giu 2016
Risposto: Shameer Parmar il 21 Giu 2016
I'm trying to figure out which function in my program (designed to solve non-linear equations) is the 'bottle-neck' of the calculation. Any useful suggestions?

Risposte (3)

Stephen23
Stephen23 il 21 Giu 2016
Modificato: Stephen23 il 21 Giu 2016

John D'Errico
John D'Errico il 21 Giu 2016
Use the profile tool to identify bottlenecks.
help profile

Shameer Parmar
Shameer Parmar il 21 Giu 2016
Simply put..
'tic' and 'toc' commands in each function one by one and check the time..
% starting of function
tic
% your code
% your code
% your code
toc
% end of this function

Categorie

Scopri di più su Physics in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by