How to check which function is the slowest one?

9 次查看(过去 30 天)
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?

回答(3 个)

Stephen23
Stephen23 2016-6-21
编辑:Stephen23 2016-6-21

John D'Errico
John D'Errico 2016-6-21
Use the profile tool to identify bottlenecks.
help profile

Shameer Parmar
Shameer Parmar 2016-6-21
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

类别

Help CenterFile Exchange 中查找有关 Physics 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by