Skip to Main Content Skip to Search
Product Documentation

Command History Preferences

You can exclude statements from the command history and specify how often to save the file in which the command history is stored, history.m. MATLAB uses the command history file for both the Command History window and statement recall in the Command Window. See also, Command History File — history.m

To set Command History preferences, select File > Preferences > Command History, and then adjust preference options as described in the table below.

PreferenceUsage
Settings

Save exit/quit commands saves exit and quit commands in the command history.

Save consecutive duplicate commands saves consecutive executions of the same statement in the command history.

With this option selected, if you run magic(5) two times in a row, both entries for magic(5) remain in the command history.

With this option cleared, the command history retains only one entry for magic(5). If you then run magic(10), the command history retains both entries.

Saving

Save history file on quit saves the command history file only when you end a MATLAB session. If the session ends abnormally, such as due to a power failure, then the MATLAB does not save the history file for that session.

Save after n commands saves the command history file after MATLAB adds n statements to it. Use this option instead of Save history file on quit if you do not want to risk losing entries to the saved history because of an abnormal termination.

Don't save history file is useful when multiple users share the same machine. It prevents each user from viewing the statements others have run.

Any entries already in the command history remain unless you first follow the instructions in Delete Entries from the Command History Window.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS