Question: how to insert row in middle of matrix using Matrix() notation?

August 22 2014 nm 605

0

I figured how to insert row in middle of a matrix using <<>> notation. But I am trying to stick to one notation which is the Matrix() and Vector() for now. 

Here is what I am trying to do. Insert a row in the third row of  Matrix. This works:

A:=< <1|2|3>,<4|5|6>,<7|8|9>>;
A:=<<A[1..2,..],<90|91|92>,A[3,..]>>;

But when I try

A:=Matrix([ [1,2,3],[4,5,6],[7,8,9]]);
A:=Matrix([ A[1..2,..], [91,92,92], A[3,..] ]);

Error, (in Matrix) this entry is too tall or too short: [91, 92, 92]

I also tried:
A:=Matrix([ A[1..2,..], Vector[row](91,92,92), A[3,..] ]);
A:=Matrix([ A[1..2,..],Matrix([[91,92,92]]), A[3,..] ]);

I am starting to think I should go back to using <<|,|,|>> notation, even thought I do not like it, but at least it seems more logical. 
How would you insert row in middle of matrix, using Matrix() constructor from an existing Matrix?

 

 

Please Wait...