Prevent MATLAB from creating empty mfile if it doesn't exist
Ältere Kommentare anzeigen
I would like to turn off the following behavior: When I try to open a mfile that doesn't exist as far as MATLAB knows*, MATLAB creates an empty mfile with that name in the present directory and opens it. Instead, when I try to open a non-existing file I would like MATLAB to return an error with no new file created. What setting do I have to change?
*Example of when this happens: I am editing mfile1 which calls mfile2. I don't realize mfile2 is not on my path. In mfile1's editor I use CNTRL-D to try and open mfile2. Since mfile2 is not on my path, it doesn't open: instead a new blank mfile2.m is created in the current directory and opened in the mfile editor.
Akzeptierte Antwort
Weitere Antworten (1)
the cyclist
am 13 Jan. 2017
Bearbeitet: the cyclist
am 13 Jan. 2017
1 Stimme
If you are doing this programmatically, then you can use the exist command to see if the file is there.
Kategorien
Mehr zu Environment and Settings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

