color in output in matlab

121 ビュー (過去 30 日間)
ali hassan
ali hassan 2022 年 2 月 5 日
コメント済み: Arif Hoq 2022 年 2 月 7 日
let say if i want my output for certain condition in red or green clor,can it be done so?
a=[1 2 3 4 4];
b=[1 2 3 4 5];
if any(abs(a-b))==1
sprintf('ali')
end
what should i add so that it will print 'ali' in red?

採用された回答

Arif Hoq
Arif Hoq 2022 年 2 月 5 日
It might be helpful
a=[1 2 3 4 4];
b=[1 2 3 4 5];
if any(abs(a-b))==1
fprintf(2,'\n ali \n')
end
1 for default, 2 for red
  2 件のコメント
ali hassan
ali hassan 2022 年 2 月 5 日
Arif Hoq
Arif Hoq 2022 年 2 月 7 日

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by