Effacer les filtres
Effacer les filtres

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

207 vues (au cours des 30 derniers jours)
Per
Per le 25 Jan 2013
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 commentaire
Ronald Hartwig
Ronald Hartwig le 27 Oct 2018
Apparently not. With more current version, simple things like cprintf and fprintf are not valid either.

Connectez-vous pour commenter.

Réponses (2)

Chunguang LI
Chunguang LI le 20 Avr 2021
fprintf(2,'only red\n'); %2 for standard error.

Evgeny Pr
Evgeny Pr le 25 Jan 2013
Use cprintf function.
This is an undocumented feature!

Catégories

En savoir plus sur Entering Commands 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