简体   繁体   English

当找不到我要打开的文件时,阻止MATLAB创建新文件

[英]Prevent MATLAB from creating a new file when it can't find the file I want to open

I will often attempt to open an existing MATLAB file from the MATLAB command window using something like: 我经常尝试使用以下内容从MATLAB命令窗口打开现有的MATLAB文件:

edit exampleFile

Alternatively, I may press cmd + shift + D with the name of a function to be opened highlighted in the editor. 或者,我可以按cmd + shift + D ,在编辑器中突出显示要打开的函数的名称。

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. 但是,如果在使用这些方法之一时我想打开的函数不在路径上,MATLAB将在当前文件夹中恼人地创建一个新的空白文件exampleFile.m 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. 理想情况下,MATLAB会在实际执行之前提示我是否要创建新文件。

In File -> Preferences -> General -> Confirmation Dialogs, there is a checkbox that says "prompt when editing a file that does not exist". 在文件 - >首选项 - >常规 - >确认对话框中,有一个复选框,显示“编辑不存在的文件时提示”。 Check it. 核实。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM