Path: news.mathworks.com!newsfeed-00.mathworks.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!news.stack.nl!aioe.org!.POSTED!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: fprintf() statements
Date: Mon, 29 Oct 2012 20:02:34 -0500
Organization: Aioe.org NNTP Server
Lines: 21
Message-ID: <k6n8vc$13q$1@speranza.aioe.org>
References: <k6n89r$sia$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: r5V25efamCd6xbVApvRVug.user.speranza.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2
X-Notice: Filtered by postfilter v. 0.8.2
Xref: news.mathworks.com comp.soft-sys.matlab:781628

On 10/29/2012 7:51 PM, Jonathan Ruffley wrote:

>
> the part of this code that was unfamiliar to me was the '1' in
>the fprintf() statement. I am aware that that position is used
>for a file identifier; is there any other reason to put a '1' in that
>position? I also experimented a bit and found that if I replace the '1' with a '2',
>the string still displays to the command window, but is the color red. Thanks for the assistance!
>

'1' is default. So use it or not, it is the same.
'2' for standard error. I guess that is why it prints in 'red' since
it is supposed to be an error message.

Here are the 3 standard file id: 0,1,2

http://en.wikipedia.org/wiki/File_descriptor

Matlab uses the same standard.

--Nasser