打开命令历史记录窗口
The Command History window displays a log of statements that you ran in the current and previous MATLAB®sessions. The Command History lists the time and date of each session in the short date format for your operating system, followed by the statements from that session. Brackets in the left margin indicate statements that were processed as a group. A colored mark precedes each statement that generated an error.
MATLAB saves statements that run in the Command Window to the history file历史记录
。这些陈述包括您使用的陈述评估选择item on context menus in tools such as the Editor, Command History window, and Help browser. By default, MATLAB automatically saves the command history file after each statement. The history file does not include every action taken in MATLAB. For example, changes to values in the Variables editor are not included in the Command History window. All entries remain until you delete them, or until the number of statements in the history file exceeds the number of statements to save, as specified in the Command History preferences. When the specified limit is reached, MATLAB automatically deletes the oldest entries. By default, the Command History window saves 25,000 statements.
You can select entries in the Command History window, and then perform these actions for the selected entries. Some actions are not available inMATLAB Online™。
Action |
如何执行动作 |
---|---|
从语句创建脚本。 |
选择一个条目或条目,然后右键单击并选择Create Script或者Create Live Script从反面text menu. The Editor opens a new file that contains the statements you selected from the Command History window. |
重新运行以前的语句。 |
做以下一个:
To extend the selection to include multiple statements, pressShift+↑. |
复制statements to another window. |
选择一个条目或条目,然后执行以下操作之一:
|
从语句创建一个喜欢的命令。 |
Select an entry or entries, and then do one of the following:
有关喜欢命令的更多信息,请参阅Rerun Favorite Commands。 |
删除entries. |
选择要删除的条目,然后右键单击并选择删除,或按删除key. To recall a deleted entry, right-click and selectUndo Delete, or pressCtrl+Z。 To delete all entries, click |
To open the Command History window with all history showing, in the Command Window, press the Up Arrow key (↑) or entercommandhistory
。To open the Command History window and display a specific statement, type any part of the statement at the prompt and then press the Up Arrow key. To change how MATLAB searches for results, click(or
inMATLAB Online)并从可用选项中进行选择,包括在任何地方匹配,Match Beginning, 和Match Case。
默认情况下,命令历史记录窗口选择了语句或Esc键按下键。要保持命令历史记录窗口打开,在命令历史记录窗口中,单击and then select eitherDetach或者Dock。如果命令历史记录窗口在分离或停靠时关闭,请转到Hometab, and in the环境section, clickLayout。Then, under节目, 点击命令历史记录and select eitherDocked或者Popup。
To keep the Command History window open inMATLAB Online, go to theHometab, and in the环境section, clickLayout。Then, under节目, 点击命令历史记录and selectDocked。