The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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: 9,822
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 " <> wrote in message <kdkdho$pk3$>...
> This code essentially gives me the output I wanted, matched rows concatenated to form an m x 4 array:
> 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].


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.