
3 Running Functions — Command Window and History
MATLAB provides other options for viewing a history of statements. See
also the following sections:
• “Recalling Previous Lines” on page 3-19, which describes using the up
arrow in the Command Window
• The
diary function reference page
• “Startup Options” on page 1-12, w hich includes the
logfile startup option
Viewing Statements in the Command Histor y
Window
The Command History window lists statements you ran in the current session
and in previous sessions. The time a nd date for each session appear at the top
of the history of statements fo r that s e ssion. Use the scroll bar or the up and
down arrow keys to move through the Command History window.
Click - to hide the history for a session, and cl ick + to show it. Select a
timestamp to select all entries for that session. With a timestamp selected,
you can press the + or - key on the numeric keypad to show and hide entries.
The Command History window and the Command Window’s statement recall
featuresavetothefile
history.m, which is stored in the same directory as
MATLAB preferences. Type
prefdir in the Command Window to see the
location of the file. The
history.m file is loaded when MATLAB starts, and
it stores a maximum of 20,000 bytes, deleting the oldest entries as n eeded
to maintain that size.
MATLAB automatically s aves the
history.m file throughout the s ession
according to the Saving preference you specified. You can choose to
automatically exclude certain statements from being written to the
history.m
file with the Settings preference. For details, see “Preferences for Command
History” on page 3-59.
3-50
Commentaires sur ces manuels