adding color in command-window output...

264 ビュー (過去 30 日間)
Kip
Kip 2011 年 9 月 7 日
コメント済み: Minh Vu 2023 年 5 月 30 日
I use fprintf to report results in the command window. I know I can report errors or warnings, and they display in red or whatever.
I'd like a general tag for fprintf to select colorized text output. I haven't seen any option in the documentaion; is it possible?
Any help would be appreciated.

採用された回答

Sean de Wolski
Sean de Wolski 2011 年 9 月 7 日
Built-in, the only way I know of is to make it red:
fprintf(2,'\nHello world\n')
use 2 as the fid.
However, Yair's cprintf claims to be able to do it.
  1 件のコメント
Minh Vu
Minh Vu 2023 年 5 月 30 日
After using this command, how can I reverse back to the original setting?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by