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

Creating a matrix by blocks

Tags: None
(comma "," separated)
koooooong
Registered Member
Posts
5
Karma
0

Creating a matrix by blocks

Wed Jul 07, 2010 11:32 pm
Is there any convenient syntax in Eigen for creating a matrix by concatenating several other matrices? That is, if A, B, and C are 3x3, and I would like to create the 9x3 matrix D=[A;B;C] (matlab notation), is there an "Eigeny" way to do this? (Obviously it could be done with a loop...) Thank you!
User avatar
bjacob
Registered Member
Posts
658
Karma
3

Re: Creating a matrix by blocks  Topic is solved

Thu Jul 08, 2010 2:07 am
Code: Select all
MatrixXf D(9, 3);
D << A, B, C;


Note that 9x3 means 9 rows so the matrices will be stacked on top of each other.


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]