Development Environment    

Viewing Statements in the Command History Window

The log in the Command History window includes statements from the current session, as well as from previous sessions. The time and date for each session appear at the top of the history of functions for that session. Use the scroll bar or the up and down arrow keys to move through the Command History window.

The Command History file is history.m. Type prefdir in the Command Window to see the location of the file. The history.m file is loaded when MATLAB starts.

The Command History file is automatically saved throughout the MATLAB session according to the Saving preference you specified. You can choose to automatically exclude certain statements from being written to the Command History with the Settings preference. For details, see Preferences for Command History.

Deleting Entries in the Command History Window

Delete entries in the Command History window when you feel there are too many and it is inconvenient finding the ones you want. All entries remain until you delete them.

To delete entries in the Command History window, select an entry, or Shift+click or Ctrl+click to select multiple entries, or use Ctrl+A to select all entries. Then right-click and select one of the delete options from the context menu:

You can also delete a selection by pressing the Delete key.

Another way to clear the entire history is by selecting Clear Command History from the Edit menu.

After deleting entries from the Command History, you will not be able to access those statements in the Command Window using features for Recalling Previous Lines.


  Command History Running Statements from the Command History Window