Prevent Windows Update from shutting down Matlab session
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I run Matlab simulations that sometimes take weeks to finish and, when Windows restarts due to an auto update, I lose all my work so I really need a way to stop auto restarts from interrupting my Matlab simulation.
Windows has an API that enables a process that has a window to block a system shutdown indefinitely until the user manually chooses what to do next. Applications like Matlab receive shutdown notifications through the WM_QUERYENDSESSION and WM_ENDSESSION messages.
How can I use this to stop my simulations from shutting down and trashing all my work?
Sometimes my sims are straightforward and easy to start up again where I left off but often they are very complex simulations with lots of complex states using vast amounts of memory that it would be very difficult to get back to without running from the start again.
0 commentaires
Réponses (2)
the cyclist
le 28 Mai 2024
When you say "stop my simulations from shutting down", do you mean "Have MATLAB pause the Windows update?"
As a Mac user, I don't know about that, but here are a couple other thoughts (that perhaps you have already had).
First, is there any to make your MATLAB simulation more robust against unexpected termination? I'm guessing that any code that's running that long is doing iterations of some kind. Can you save your workspace after each iteration (or every 10 or 100, if saving takes too long)? That's just good programming practice, and guards against any failure.
Second, have you looked at Windows settings, to prevent fully automated updates? I know that on a Mac, one has decent control over this.
Voir également
Catégories
En savoir plus sur Application Deployment 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!