Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Command Window Font Color
Date: Fri, 2 Nov 2007 10:42:12 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 27
Message-ID: <fgeuu4$ig6$1@fred.mathworks.com>
References: <fgescs$hg8$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1194000132 18950 172.30.248.38 (2 Nov 2007 10:42:12 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 2 Nov 2007 10:42:12 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: news.mathworks.com comp.soft-sys.matlab:435788



"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