display different colors in command window, using command "disp" or similar

262 ビュー (過去 30 日間)
Per
Per 2013 年 1 月 25 日
回答済み: Chunguang LI 2021 年 4 月 20 日
I want sections of my display to be in differnt colors. (Matlab 2009)
ex:
disp('Hello matlab Central!')
Is it possible to get that text in example red?
disp('Hello matlab Central','red')
Thanks
  1 件のコメント
Ronald Hartwig
Ronald Hartwig 2018 年 10 月 27 日
Apparently not. With more current version, simple things like cprintf and fprintf are not valid either.

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

回答 (2 件)

Chunguang LI
Chunguang LI 2021 年 4 月 20 日
fprintf(2,'only red\n'); %2 for standard error.

Evgeny Pr
Evgeny Pr 2013 年 1 月 25 日
Use cprintf function.
This is an undocumented feature!

カテゴリ

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