From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: catching \n (newline)
Date: Tue, 21 Aug 2007 12:28:32 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 16
Message-ID: <faelpg$j2d$>
References: <fad4r2$m0a$> <fad87q$leu$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1187699312 19533 (21 Aug 2007 12:28:32 GMT)
NNTP-Posting-Date: Tue, 21 Aug 2007 12:28:32 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: comp.soft-sys.matlab:424770

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

replace with: strcmp(a,sprinf('\n'));

Note: this is a platform-independent solution, that takes
care of Unix (\n=char(10)), PCs (\n=[char(10),char(13)]) and
Macs (\n=char(13)). Don't use char(10),char(13) unless
you're certain about your intended platform. FYI, you can
get your system's line separator using the following:


Yair Altman