Modify Command History Settings
You can exclude statements from the Command History and specify how many commands to save.
You also can change the way you search for previously run statements in the Command History. Select from different search text matching options and change the way results are displayed in the Command History.
Note
When you exclude statements from the Command History, you cannot recall them in the Command Window, nor can you view them in the Command History.
To modify Command History settings, on the Home tab, in the Environment section, click Settings. Select MATLAB > Command History, and then adjust the options as described in the following table.
Option | Usage |
---|---|
Save | Select Save exit/quit commands to save
|
Select Save consecutive duplicate commands to save consecutive executions of the same statement in the Command History.
| |
Select Don't save history file to prevent saving the Command History across sessions. This option is useful when multiple users share the same machine. For example, the option prevents each user from viewing statements others have run. Any entries predating the current session remain unless you first delete entries from the Command History. | |
Save last n commands
specifies the number of commands to save. | |
Match | Select Match anywhere to retrieve statements that contain the search text in any location. Select Match beginning to retrieve statements that begin with the search text. This option is selected by default. |
Select Match case to retrieve statements that match the case of the search text. | |
Select Filter matches to display only statements that match the search text. Clear Filter matches to display all previously run statements and highlight the statements that match the search text. |
Change the Command History Date Format
MATLAB® uses the short date format of your operating system to display dates in the Command History. To change the date format, for instance from MM/DD/YYYY to DD/MM/YYYY:
Change the short date format for your operating system as described in its documentation.
Restart MATLAB.
Note
Clearing the Command History deletes all entries from the Command History. You can no longer recall those entries in the Command Window.