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

286 Ansichten (letzte 30 Tage)
Per
Per am 25 Jan. 2013
Beantwortet: Chunguang LI am 20 Apr. 2021
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 Kommentar
Ronald Hartwig
Ronald Hartwig am 27 Okt. 2018
Apparently not. With more current version, simple things like cprintf and fprintf are not valid either.

Melden Sie sich an, um zu kommentieren.

Antworten (2)

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

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

Kategorien

Mehr zu Entering Commands finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by