how do I freeze and save entire function state?

4 vues (au cours des 30 derniers jours)
Moshe
Moshe le 12 Sep 2013
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.

Réponses (2)

Walter Roberson
Walter Roberson le 12 Sep 2013
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 le 12 Sep 2013
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.

Catégories

En savoir plus sur Simulation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by