问题
I will often attempt to open an existing MATLAB file from the MATLAB command window using something like:
edit exampleFile
Alternatively, I may press cmd + shift + D
with the name of a function to be opened highlighted in the editor.
However, if the function I wish to open is not on the path when using either of these methods, MATLAB will irritatingly create a new blank file exampleFile.m
in the current folder. This is extremely annoying. Is there a way to stop this? Ideally, MATLAB would prompt to see if I wanted to create a new file before actually doing it.
回答1:
In File -> Preferences -> General -> Confirmation Dialogs, there is a checkbox that says "prompt when editing a file that does not exist". Check it.
来源:https://stackoverflow.com/questions/4663659/prevent-matlab-from-creating-a-new-file-when-it-cant-find-the-file-i-want-to-op