How to view the command window history?

80 ビュー (過去 30 日間)
Xiaohan Du
Xiaohan Du 2018 年 4 月 3 日
回答済み: Anshuman 2024 年 2 月 8 日
Hi all,
If there is a long command being executed and result being displayed, MATLAB does not show the full history in the command window, i.e. if I scroll all the way up in command window I still cannot see the history. Any idea how to check the history in command window if a long result is displayed?
  1 件のコメント
Manan Mishra
Manan Mishra 2018 年 4 月 6 日
One way could be to store the result in a file, please refer the following link for information on how to do this:

サインインしてコメントする。

回答 (1 件)

Anshuman
Anshuman 2024 年 2 月 8 日
If you are working on scripts that produce a lot of output, you can log all command window output to a file by using the "diary" function.
To start logging:
diary on
To stop logging:
diary off
By default, MATLAB creates a file named diary in the current working directory. You can specify a different file name by passing a string to the diary function, like so:
diary myoutput.txt
This will save all the command window output to myoutput.txt.

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by