Effacer les filtres
Effacer les filtres

producing colored letters in an if statement

1 vue (au cours des 30 derniers jours)
salva
salva le 30 Juil 2012
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 commentaire
Jan
Jan le 30 Juil 2012
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?

Connectez-vous pour commenter.

Réponse acceptée

Daniel Shub
Daniel Shub le 30 Juil 2012
Modifié(e) : Daniel Shub le 30 Juil 2012
You can do this with Yair's FEX:cprintf. Once you download and install the tool, you can do
cprintf('red', 'Do That');
  3 commentaires
Walter Roberson
Walter Roberson le 30 Juil 2012
cprintf('Red', 'Do That');
Daniel Shub
Daniel Shub le 30 Juil 2012
Modifié(e) : Daniel Shub le 30 Juil 2012
@Walter, thank you
@Salva sorry about that, I got the syntax wrong. I edited the answer to the correct way.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by