Borrar filtros
Borrar filtros

Command Window (Whole Program Iterations)

2 visualizaciones (últimos 30 días)
Mustafa
Mustafa el 2 de Sept. de 2011
Is it possible to check the whole history of a program which has let say i=20000 iteration. I have tried to debug the code but everything works fine till i=200 but i can't go till 20000.
The thing is when the program finishes, i can only see last couple of hundred iterations.
Is there anyway,i can check the whole program iteration(other than debugging)

Respuesta aceptada

the cyclist
the cyclist el 2 de Sept. de 2011
There are at least two approaches that you can take in this situation:
(1) Use "cell mode". Use a conditional breakpoint to stop the code just before it hits the bad iteration. Then, enclose the failing part of the code in a cell (surrounding by "%%" before and after), and you can execute only the failing part. When it crashes, it will not take you completely out of the program.
(2) Save the workspace, and start from there each time. Again, use a conditional breakpoint to stop just before the bad iteration. Save the workspace. Then, instead of running the code for the first 200 iterations, just load the workspace, and run the rest of the code from there.
  1 comentario
Mustafa
Mustafa el 2 de Sept. de 2011
Thanks both approaches sounds good. I will give it a try.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Debugging and Analysis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by