How to save data when execution is paused

18 visualizaciones (últimos 30 días)
Divij Gupta
Divij Gupta el 24 de Jun. de 2021
Editada: Swetha Polemoni el 28 de Jul. de 2021
I have a code runs a loop a million times. In each iteration, a new row of data is filled into a matrix. I want to find a way such that if I press the 'pasue' button (Matlab 2021), it saves the relevant variables so I can 'resume' the task by feeding that data back into a function.
Basically I am looking for a function I can put in the script that can detect when the pause button has been hit so it can save the data from RAM to a text file.

Respuestas (1)

Swetha Polemoni
Swetha Polemoni el 23 de Jul. de 2021
Editada: Swetha Polemoni el 28 de Jul. de 2021
Hi Divij Gupta
In Matlab, whenever a pause button is pressed all the workspace variables are updated according the latest run of the program. You can save these updated workspace variables in a mat file or txt file using save by executing this save command from command window without disturbing the execution of current program in pause mode.
You may find the following answer helpful.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by