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.

답변 (2개)

Walter Roberson
Walter Roberson 2013년 9월 12일

0 개 추천

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 2013년 9월 12일

0 개 추천

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.

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

질문:

2013년 9월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by