I've been using the command-line matlab interface (matlab --nodesktop) a lot lately.

When I want to jump out of matlab and back to my bash shell, my instinct is to do Ctrl+D. I guess the bash and python shortcuts conditioned me to automatically do Ctrl+D. Problem is, matlab wants me to type exit instead of hitting Ctrl+D.

Is there a way to convince matlab to let me exit the command line interface by doing Ctrl+D?

  • Please check whether the given answer helps, and accept it if so. Otherwise elaborate on the problem as it is not desirable to leave the question open. Jan 13, 2014 at 13:12

1 Answer 1


I have just checked and it is indeed possible to exit matlab with a hotkey. The default setting is Ctrl+Q but of course you can change this as described on the Mathworks blog.

Setting it is most easily done without -nodesktop, but the hotkeys do work in nodesktop mode.

  • haven't looked at the mathworks blog yet, but Ctrl+Q doesn't seem to work using the default configuration. Nov 14, 2012 at 17:25
  • Perhaps the hotkeys differ per version or OS, it should only take you 2 mins to check the blog and see whether you can make it work. Nov 14, 2012 at 20:59
  • It's been a while since this was asked, but in 2018 Ctrl+Q still doesn't work for me when using -nodesktop in Ubuntu Linux. The same shortcut does work fine on the same system when using the GUI. I would love a solution for this as well but outside of a text-expander utility or other outside-Matlab hack, there doesn't seem to be one.
    – Matt
    Apr 14, 2018 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.