From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Matching data based on columns
Date: Wed, 18 Mar 2009 18:33:00 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 22
Message-ID: <gpreos$cjt$>
References: <gphqm6$eh5$> <gpif2l$rg2$> <gpjaju$pkq$> <gpjbht$l97$> <gpjlkd$j8e$> <gpkkkc$l9e$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1237401180 12925 (18 Mar 2009 18:33:00 GMT)
NNTP-Posting-Date: Wed, 18 Mar 2009 18:33:00 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1756295
Xref: comp.soft-sys.matlab:525951

"Roger Stafford" <> wrote in message <gpkkkc$l9e$>...
> "R L" <> wrote in message <gpjlkd$j8e$>...
> > Thank you very much Roger! I hope you'll have a great and safe trip. I look forward to hearing back from you! 
> > R L
>   Yes I returned safe but tired, R L.  As an octogenarian I guess I am getting a little old for this hiking stuff.
>   Darren's solution to your alteration looks valid.  The other way to do it would be to create d just three columns wide and divide by it in the proper three column section of T.  The remaining two columns of T could simply be appended as they are.  I am referring to the T produced by 'accumarray' with sums in it, not the earlier T.
>  ......
>  d = repmat(diff(find([true;diff(n)~=0;true])),1,3);
>  B = [B,T(;,1:3)./d,T(:,4:5)];
>   I'll let you figure out the generalization in terms of p, q, and one more initially defined parameter: the width of the section to be simply added.
> Roger Stafford

Sorry for the late reply --- been busy in the last few days. 

Great solution and thanks for the pointers to all of you! Thanks again!