Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Problem using horzcat with index vectors in a for loop
Replies: 7   Last Post: Jan 22, 2013 6:45 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Bruno Luong

Posts: 8,708
Registered: 7/26/08
Re: Problem using horzcat with index vectors in a for loop
Posted: Jan 21, 2013 6:41 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.