How to Append matrices together in nalgebra Rust?

375 Views Asked by At

Suppose I have a matrix [[1,0],[0,1]] and [[2,0],[0,2]] I want to figure out a way to combine these 2 matrices into [[1,0,2,0],[0,1,0,2]]. I cannot find the appropriate constructor in the documentation: https://www.nalgebra.org/docs/user_guide/vectors_and_matrices/#matrix-construction that will help me solve this problem.

I also tried firstly declaring an empty Dynamic matrix like DMatrix and then appending the rows using insert_row() but it seems that insert_row() can only be used to insert rows which are all just filled with the same constant number.

0

There are 0 best solutions below