当找不到我要打开的文件时,阻止MATLAB创建新文件 [英] Prevent MATLAB from creating a new file when it can't find the file I want to open
问题描述
我经常尝试使用以下内容从MATLAB命令窗口打开现有的MATLAB文件:
I will often attempt to open an existing MATLAB file from the MATLAB command window using something like:
edit exampleFile
或者,我可以按 cmd + shift + D
在编辑器中突出显示要打开的函数的名称。
Alternatively, I may press cmd + shift + D
with the name of a function to be opened highlighted in the editor.
但是,如果使用这些方法之一我想打开的函数不在路径上,MATLAB会恼人地创建一个新的空白文件当前文件夹中的exampleFile.m
。这非常烦人。有办法阻止这个吗?理想情况下,MATLAB会在实际执行之前提示我是否要创建新文件。
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.
推荐答案
在文件 - >首选项中 - >常规 - >确认对话框,有一个复选框,显示编辑不存在的文件时提示。检查一下。
In File -> Preferences -> General -> Confirmation Dialogs, there is a checkbox that says "prompt when editing a file that does not exist". Check it.
这篇关于当找不到我要打开的文件时,阻止MATLAB创建新文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!