Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: catching \n (newline)
Date: Mon, 20 Aug 2007 23:31:06 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 32
Message-ID: <fad87q$leu$1@canopus.cc.umanitoba.ca>
References: <fad4r2$m0a$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1187652666 21982 192.70.172.160 (20 Aug 2007 23:31:06 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Mon, 20 Aug 2007 23:31:06 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:424709



In article <fad4r2$m0a$1@fred.mathworks.com>,
Naor Movshovitz <lazy_n@yahoo.com> wrote:
>sorry about the stupid question but,

>>> a=sprintf('\n');
>>> strcmp(a,'\n')

>ans =
>
>     0

>and i don't see anything in the help for strcmp.

In the *printf() I/O functions, \n is a special token sequence
representing newline. In most other places in matlab, \n is
a two character sequence, \ and n.

>> a=sprintf('\n');
>> strcmp(a,char(10))

ans =

     1
>> length('\n')

ans =

     2


-- 
  All is vanity.                                       -- Ecclesiastes