Search All of the Math Forum:

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

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

 Search Thread: Advanced Search

 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 22, 2013 5:31 AM
 Plain Text Reply

nl.doc@arcor.de wrote in message <7db9a287-0e77-4367-94e1-a7e73a20411c@googlegroups.com>...
> Does the following line execute the correct task?
> Independently of the dimension of A and B (only number of columns should be the same).
>
> desired=[A(ia,:),B(ib,:)];

A(ia,:) is equal to B(ib,:) and is equal to C, regardless the number of rows of A and B.

>
> But I don't know why doubling the columns, because per definition
> A(ia,:) is identically B(ib,:) when using intersect.

Don't understand your question. They are identical,, therefore you just duplicated C twice on the horizontal dimension. I though I make it clear in my previous post.

Bruno

Date Subject Author
1/21/13 Bruno Luong
1/21/13 Bruno Luong
1/22/13 NoLi
1/22/13 Bruno Luong
1/22/13 Bruno Luong

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