Copy the text from the command window automatically

24 ビュー (過去 30 日間)
Alikouider
Alikouider 2022 年 1 月 12 日
コメント済み: Star Strider 2022 年 1 月 12 日
Hello all,
I would like to know the script to copy the text from the command window from matlab
and create an excel file automatically
is it possible?
thanks in adavance for your help and mostly your comprehension
  1 件のコメント
Rik
Rik 2022 年 1 月 12 日
Copying the contents of the command window is not trivial. It is often much easier to redirect the output of functions before they end up in the command window.
Also, what is the purpose of that excel file? Do you want to store the plain text output of the command window to excel?
Have a read here and here. It will greatly improve your chances of getting an answer.

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

採用された回答

Star Strider
Star Strider 2022 年 1 月 12 日
The diary function is an option, however if the code is printing to the Command Window, it would likely be easier to print it to a file as well. There are a number of ways to do this, one by opening a file for writing using the fopen function (remember to use fclose to close it later) then using essentially the same fprintf call. Putting the data in a table would then allow it to be written as a table. There many others (such as writematrix) that would then allow writing directly to a file.
.
  2 件のコメント
Alikouider
Alikouider 2022 年 1 月 12 日
Thanks again
Star Strider
Star Strider 2022 年 1 月 12 日
As always, my pleasure!
.

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by