Close MATLAB from the keyboard
6 次查看(过去 30 天)
显示 更早的评论
I would like to save a file or close it automatically by running a command. Something like: keyboard ("EXIT")
0 个评论
采纳的回答
更多回答(2 个)
Steven Lord
2018-1-8
If you want to close MATLAB using commands or shortcuts, see Birdman and Sean's answers.
If you want to "save a file or close it automatically" when that file is open in the MATLAB Editor rather than closing MATLAB itself, you can use the matlab.desktop.editor API.
help matlab.desktop.editor
help matlab.desktop.editor.Document
If you've opened a file using the low-level file I/O command fopen, use the fclose command to close it when you're done working with it.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Entering Commands 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!