Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Problem using horzcat with index vectors in a for loop
Date: Mon, 21 Jan 2013 23:41:09 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 18
Message-ID: <kdkjml$fp3$1@newscl01ah.mathworks.com>
References: <kdhu6v$o6p$1@newscl01ah.mathworks.com> <kdkdho$pk3$1@newscl01ah.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
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 1358811669 16163 172.30.248.47 (21 Jan 2013 23:41:09 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 21 Jan 2013 23:41:09 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:787037

"Thomas " <thomas.seers@postgrad.manchester.ac.uk> wrote in message <kdkdho$pk3$1@newscl01ah.mathworks.com>...
> This code essentially gives me the output I wanted, matched rows concatenated to form an m x 4 array:
> OUTPUT
> D =
> 
>      2     4     2     4
>      3     1     3     1
>      5     7     5     7
>      8     4     8     4
> This output is fine though it runs a bit slow on big datasets.

As I suspect, D is equal to [C C] or repmat(C,[1 2]). Why bother with ia, ib????
 
I don't understand the rest of your post, with x, xy, ind etc...

If you want to reconstruct D from A, and B, it's just [A(ia,:) B(ib,:)], but again it's the same as [C C].

Bruno