How can I shut down Windows from the command line or a MATLAB function in MATLAB?
18 次查看(过去 30 天)
显示 更早的评论
I have a program that runs for a long time. I would like to shut down the computer automatically when execution stops.
采纳的回答
MathWorks Support Team
2010-1-19
You can shut down Windows from a MATLAB function or the MATLAB command prompt by using the following code:
system('shutdown -s')
When using this, keep in mind that it WILL shut down your system unless you call the command again with the "-a" flag in the alloted time. There will be no prompt asking to confirm the shutdown. Also note that this may not work if there are Microsoft Office programs running at the time the shutdown is requested.
For more information on the shutdown operation, type:
system('shutdown /?')
at the MATLAB Command Prompt.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!