It\'s quite a simple task, but I was not able to find an answer to it:
Using the Eigen library, suppose I have Matrix2Xd mat and Vector2d vec
Matrix2Xd mat
Vector2d vec
You can use conservativeResize for that purpose:
conservativeResize
mat.conservativeResize(mat.rows(), mat.cols()+1); mat.col(mat.cols()-1) = vec;