From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to average one of column and then duplicate each row to next row?
Date: Thu, 5 Feb 2009 19:07:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <gmfdcl$sda$>
References: <gmf1pe$jtm$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1233860822 29098 (5 Feb 2009 19:07:02 GMT)
NNTP-Posting-Date: Thu, 5 Feb 2009 19:07:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:516422

"Kuo-Hsien" <> wrote in message <gmf1pe$jtm$>...
> .......
> Please advice me some easier method to rearrange this question I'm trying to solve.
> .......

  On the basis of what I see in your example, it has nothing to do with an "average".  You seem to be duplicating each row and dividing the fifth column by two.

  Call x the original data.

 [m,n] = size(x);
 x(:,n) = x(:,n)/2;
 x = reshape(repmat(x(:),1,2).',[],n);

Roger Stafford