Registered Member
|
Hi
I'm new to Eigen. Apologies for a basic question. I'm trying to work out how I can simply concatenate matrices as per Matlab: A = [ 1 2 3, 7 8 9, 13 14 15] B = [4 5 6, 10 11 12, 16 17 18]; C = [A B]; ans = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 I know I can copy a matrix A to C, and resize C, and then copy values across, but is there any way to do this in one to two lines of code? Thanks, Peter |
Moderator
|
2 lines:
C.resize(A.rows(),A.cols()+B.cols()); C << A, B; |
Registered Member
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]