Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
text in any color in the command window ??

Subject: text in any color in the command window ??

From: JAN

Date: 16 Aug, 2007 08:01:41

Message: 1 of 3

Hello,

can I print text in the command window in any color except
black (e.g. with the 'disp' command). Like the 'error'
command, but I want to see only my text and not more and
in blue or green.

Thanx so far.

JAN

Subject: text in any color in the command window ??

From: Yair Altman

Date: 16 Aug, 2007 08:23:34

Message: 2 of 3

"Jan " <j_barthel@gmx.de> wrote in message
<fa1095$83b$1@fred.mathworks.com>...
> Hello,
>
> can I print text in the command window in any color except
> black (e.g. with the 'disp' command). Like the 'error'
> command, but I want to see only my text and not more and
> in blue or green.
>
> Thanx so far.
>
> JAN


You can display in red using fprintf(2,'my text...\n'). You
can display in blue-underline using fprintf('<a
href="">test</a>\n'). Aside from that I couldn't find any
other option, and not from lack of trying. I'd be happy to
learn...

BTW, you can modify the entire foreground & background &
selection colors of the command window text, but not of a
specific text section within the window. I'm sure there's a
way somehow, because Matlab does it - I just haven't figured
it out yet...

Yair Altman
http://ymasoftware.com

Subject: text in any color in the command window ??

From: Yair Altman

Date: 13 May, 2009 14:04:02

Message: 3 of 3

After a very long investigation, I am proud to announce that I have solved the problem of displaying text in any color (with possible underline) in the Command Window. It works on all Matlab 7 versions.

Interested readers can find details here:
http://undocumentedMatlab.com/blog/cprintf-display-formatted-color-text-in-command-window/

Yair Altman
http://UndocumentedMatlab.com
 

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us