Thread Subject: Command Window Font Color

Subject: Command Window Font Color

From: Luke

Date: 2 Nov, 2007 09:58:52

Message: 1 of 3

Is it possible to output to the command window, in a
specfifc color, say by using disp, or fprintf.

For example:
I want to output font like PASS (in green), or FAIL (in
red).

Subject: Command Window Font Color

From: Yair Altman

Date: 2 Nov, 2007 10:42:12

Message: 2 of 3

"Luke " <luke.bagnall@airbus.com> wrote in message
<fgescs$hg8$1@fred.mathworks.com>...
> Is it possible to output to the command window, in a
> specfifc color, say by using disp, or fprintf.
>
> For example:
> I want to output font like PASS (in green), or FAIL (in
> red).

You can't control the color programatically, except the
following:

fprintf(2,'whatever') will print in red just like anything
else spilled into STDERR (FID=2). You can also use '<a
href=...>...</a>' to display something in blue underline. Of
course, if you change colors in the Preferences or
*.ColorPrefs, you'll get other colors, but this affects the
entire Command Window at once, not just text displayed from
now on.

There's probably an undocumented hack somewhere, but I
haven't found it yet (and my question to Kristin on this
went unanswered...)

Yair Altman
http://ymasoftware.com

Subject: Command Window Font Color

From: Luke

Date: 2 Nov, 2007 11:13:37

Message: 3 of 3

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message
<fgeuu4$ig6$1@fred.mathworks.com>...
> "Luke " <luke.bagnall@airbus.com> wrote in message
> <fgescs$hg8$1@fred.mathworks.com>...
> > Is it possible to output to the command window, in a
> > specfifc color, say by using disp, or fprintf.
> >
> > For example:
> > I want to output font like PASS (in green), or FAIL (in
> > red).
>
> You can't control the color programatically, except the
> following:
>
> fprintf(2,'whatever') will print in red just like anything
> else spilled into STDERR (FID=2). You can also use '<a
> href=...>...</a>' to display something in blue underline.
Of
> course, if you change colors in the Preferences or
> *.ColorPrefs, you'll get other colors, but this affects
the
> entire Command Window at once, not just text displayed
from
> now on.
>
> There's probably an undocumented hack somewhere, but I
> haven't found it yet (and my question to Kristin on this
> went unanswered...)
>
> Yair Altman
> http://ymasoftware.com
>

I wondered if you could change the preferences, but that's
no good if it changes everything. I'm sure there must be a
a crude way of forcing it.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com