Computational times for various routines?
Mostrar comentarios más antiguos
I am solving a "stochatic" optimization problem using fminunc/fmincon. I'm currently using a fairly simple construction, but am slowly adding layers of complexity (additional time periods, variables, dynamics, etc.). Not surprisingly each addition slows the algorithm down considerably.
Is there a way to see (e.g. for each iteration the computational time spent on 'factorKKTmatrix') how much time each subroutine is taking to compute? I have a feeling my bottle neck is the finite-difference approach to computing the gradient/hessian, but I'd like to make sure this is the case.
Thanks
Respuestas (2)
Azzi Abdelmalek
el 22 de Ag. de 2013
1 voto
You can use tic toc
2 comentarios
Pete
el 22 de Ag. de 2013
Azzi Abdelmalek
el 22 de Ag. de 2013
In each part of your code use for example
tic
% part1
t1=toc
tic
%part2
t2=toc
Kelly Kearney
el 22 de Ag. de 2013
Try the Profiler.
doc profile
Categorías
Más información sobre Get Started with Optimization Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!