Added test for matrix dimension

I have added thes to implement the initialization of matrices when
values are provided.