How do you make a matrix out of vectors in eigen?

DanielLC picture DanielLC · May 9, 2013 · Viewed 13.1k times · Source

I have four column vectors. I need to append them to make a four by four matrix. Is there a constructor or something for that?

Answer

ggael picture ggael · May 10, 2013

You can also append them using the comma initializer syntax:

m << v1, v2, v3, v4;

The matrix m must have been properly resized first.