Close MATLAB from the keyboard
10 views (last 30 days)
Show older comments
GEORGIOS BEKAS on 8 Jan 2018
Answered: Steven Lord on 8 Jan 2018
I would like to save a file or close it automatically by running a command. Something like: keyboard ("EXIT")
More Answers (2)
Steven Lord on 8 Jan 2018
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.
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.
Find more on Entering Commands in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!