how do I freeze and save entire function state?

Hi, I am running a large simulation (function with "children" functions), which takes a long time to produce data. when I need to debug an event which happens after a long time, I am running the simulation with same seed and under debug mode (breakpoints), and wait. my question - is there a way of saving the whole function data and memory to a file, so I can reproduce the situation again by just loading it somehow, instead of re-running the whole simulation?
thanks.

Respuestas (2)

Walter Roberson
Walter Roberson el 12 de Sept. de 2013

0 votos

There is no provided mechanism to freeze and save function state.
It gets messy when you start involving objects (graphics or OOP), or open files, or threads, or additional processes (e.g, sound playing).
There is some back-tracking that can be done... but it only works on some kinds of functions if I recall.
Restoring the state would be tricky, especially as MATLAB has no way to restore a call stack.
Jan
Jan el 12 de Sept. de 2013

0 votos

You can freeze a virtual machine. So install Matlab in a new virtual machine, freeze the complete state, create a copy of the state and start it as often as your want.

Categorías

Más información sobre Simulation en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 12 de Sept. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by