1
votes

I'm using MATLAB R2012a with a dual-screen setup, so I have the command window on one screen and the M-file editor on the other. Sometimes when I make changes to my source code, I'll accidentally press Ctrl+S while the command window is in focus (instead of the editor). This loads a file chooser dialog for saving a MAT file of the workspace. However, regardless of whether I press "Cancel" or "OK", MATLAB hangs indefinitely. Is there something I can do so that saving the workspace doesn't fail?

I don't really care about being able to save the workspace, I just need it to work so that MATLAB doesn't hang whenever I accidentally try to.

1
The ^C (control + C) operator cancels operations in Matlab, have you tried that? I'm using 2012a and haven't had any issues with this. - gkiar
@knowah: Do you get the same behavior using a single monitor? Perhaps you should consider filing a bug report. Also I've had issue with the MATLAB IDE if I force it to use Java 7 instead of the embedded JRE 6 (using the MATLAB_JAVA environment variable). So make sure thats not the case for you - Amro
@Amro I know, I am saying after closing the prompt, if the computer seems stuck, try pressing Ctrl+C to cancel whatever operation may still be going on. I highly doubt the fact that multiple screens are used has any effect, I interpreted that as more of an 'excuse' as to why the OP accidentally saves the command window. - gkiar
@knowah Another point to ask, what is your OS? - gkiar
@iKiar: Correct, the dual screen thing is just the reason why I accidentally save. Ctrl+C has no effect (which is that I would think considering it's not actually running a MATLAB command.) I'm using Windows 7. - knowah

1 Answers

2
votes

As a temporary fix, you can un-define the Ctrl+S shortcut to save the workspace from the settings.

Go to File > Preferences > Keyboard > shortcuts:

screenshot