フィルターのクリア

producing colored letters in an if statement

1 回表示 (過去 30 日間)
salva
salva 2012 年 7 月 30 日
Is there any way to display the warning ‘Do that’ in the below if statement in red colour so that it can stand out?
If
'Do that'
end
thanks
  1 件のコメント
Jan
Jan 2012 年 7 月 30 日
Do you mean inside the source code, when it is displayed in the editor? Or when printed to paper? Or displayed as strings in the command window? Or in a editable text field in a GUI?

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

採用された回答

Daniel Shub
Daniel Shub 2012 年 7 月 30 日
編集済み: Daniel Shub 2012 年 7 月 30 日
You can do this with Yair's FEX:cprintf. Once you download and install the tool, you can do
cprintf('red', 'Do That');
  3 件のコメント
Walter Roberson
Walter Roberson 2012 年 7 月 30 日
cprintf('Red', 'Do That');
Daniel Shub
Daniel Shub 2012 年 7 月 30 日
編集済み: Daniel Shub 2012 年 7 月 30 日
@Walter, thank you
@Salva sorry about that, I got the syntax wrong. I edited the answer to the correct way.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by