Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Data Manipulation (Re-arranging) and Writing to text file
Date: Wed, 20 Jun 2012 06:02:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <jrrp0t$8a$1@newscl01ah.mathworks.com>
References: <jrm6nb$787$1@newscl01ah.mathworks.com> <jrmb7j$5iu$1@speranza.aioe.org> <jrnf37$nlk$1@newscl01ah.mathworks.com> <jrno98$luu$1@speranza.aioe.org> <jro45e$lh6$1@speranza.aioe.org>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1340172125 266 172.30.248.47 (20 Jun 2012 06:02:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 20 Jun 2012 06:02:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3536503
Xref: news.mathworks.com comp.soft-sys.matlab:771628

I've gone through this. Two questions:

1. Could you explain the two fprintf lines and the first repmat line?

2. I'm getting the following error message:

Index exceeds matrix dimensions.

Error in test3 (line 7)
   fprintf(f1,x(i1:i2))

I'm using MATLAB 2012a. Could there be a version conflict?

> dpb <none@non.net> wrote in message <jro45e$lh6$1@speranza.aioe.org>...
> 
> Just a minor cleanup of a formatting problem and a few fewer magic 
> numbers...
> 
> i1=1;
> while i1<length(x)
>    i2=i1+59;
>    fprintf(f1,x(i1:i2))
>    i1=i2+1; i2=i1+1;
>    fprintf(f2,x(i1:i2))
>    i1=i2+4;
> end
> 
> --