MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

  • Save files to matlabroot folders using an external editor, run rehash toolbox
    before you use the files in the current session.

  • Add or remove files from matlabroot folders using file system operations, run
    rehash toolbox before you use the files in the current session.

  • Modify existing files in matlabroot folders using an external editor, run clear
    function-name before you use these files in the current session.


For more information, see rehash or “Toolbox Path Caching in MATLAB”.


Backing Up Files


When you modify a file in the Editor, the Editor saves a copy of the file using the same file
name but with an .asv extension every 5 minutes. The backup version is useful if you
have system problems and lose changes you made to your file. In that event, you can open
the backup version, filename.asv, and then save it as filename.m to use the last good
version of filename.


NoteThe Live Editor and MATLAB Online do not automatically save copies of files.


To select preferences, click Preferences, and then select MATLAB > Editor/
Debugger > Backup Files on the Home tab, in the Environment section. You can then:



  • Turn the backup feature on or off.

  • Automatically delete backup files when you close the corresponding source file.


By default, MATLAB automatically deletes backup files when you close the Editor. It is
best to keep backup-to-file relationships clear and current. Therefore, when you
rename or remove a file, consider deleting or renaming the corresponding backup file.


  • Specify the number of minutes between backup saves.

  • Specify the file extension for backup files.

  • Specify a location for backup files


If you edit a file in a read-only folder and the back up Location preference is Source
file directories, then the Editor does not create a backup copy of the file.

Open and Save Files in the Editor
Free download pdf