This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Matrix concatenation

Tags: None
(comma "," separated)
agaz1985
Registered Member
Posts
3
Karma
0

Matrix concatenation

Fri Apr 22, 2011 9:48 am
Hi,
I would like to perform an horizontal/vertical matrix concatenation between two matrices. Is it possible with Eigen or I have to write my own concatenation function ?

I searched on eigen documentation but unfortunatly i didn't find any method that do this operation.

Thanks,
Angelo.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Matrix concatenation

Fri Apr 22, 2011 1:49 pm
you can use the comma initializer syntax:

C.resize(A.rows(),A.cols()+B.cols());
C << A,B;

or:

C.resize(A.rows()+B.rows(),A.cols());
C << A,B;
agaz1985
Registered Member
Posts
3
Karma
0

Re: Matrix concatenation

Sat Apr 23, 2011 9:46 am
It works ! Thanks a lot.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora