No BSD License  

2.25

2.2 | 4 ratings Rate this file 12 Downloads (last 30 days) File Size: 1.94 KB File ID: #8783

Turn off your Windows Computer from within MATLAB after a long unattended calculation

by

 

21 Oct 2005 (Updated )

Turn off a Windows machine from within MATLAB.

| Watch this File

File Information
Description

I find this function very useful for automatically turning off my Windows computer after a long, unattended MATLAB calculation is complete. Of course, the usual issues with Windows processes occasionally refusing to halt emerges, but when MATLAB is the only "serious" process executing, I find that the SHUTDOWN function almost always works in turning off the computer. The system shudown command is executed with the appropriate options to force any running applications to close, so be sure so save your data and close other applications before beginning your unattended MATLAB calculation (and design your MATLAB calculation to save its own data before terminating). I've used this function myself with no problems, but as always, there are no warranties; use at your own risk.

Note: you can use this function BEFORE starting your calculation, by estimating the required execution time, or you can use this function AFTER the calculation (recommended) by calling it when your calculation is complete.

Note: If you change your mind, you can use this command to ABORT a shutdown as well. (Use "help shutdown" for more information.)

Michael Kleder, Oct 2005

MATLAB release MATLAB 7.0.4 (R14SP2)
Other requirements Windows platforms only; tested on Windows XP SP 2
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
23 Oct 2012 Dick

Absolute nonsense. The command
system('shutdown -s')
works just as well.

23 Oct 2012 Casper  
10 Feb 2007 The Author

"Of course, the usual issues with Windows processes occasionally refusing to halt emerges, but when MATLAB is the only "serious" process executing, I find that the SHUTDOWN function almost always works in turning off the computer."

27 Nov 2006 Dimitri Shvorob

It just doesn't work. (Yes, I have WinXP, and Matlab is the only active application. I tried two PCs). The code is basically a one-liner.

23 Nov 2006 Vladimir Kazalov

How turn off linux computer from matlab?

14 Jun 2006 Ali Baghaei

a very useful function specially when the power is not sustainable

Contact us