Question: Removing some columns and lines from a matrix

Hello,

 

this is probably a silly problem but I really didn't find any command for it.

Suppose I have a matrix and I want to remove some rows and columns to consider a smaller matrix within it. Is there a nice way to do it?  This is what I came up with:

restart;with(LinearAlgebra);

 

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

 

temp := <(Column(A, 2)| Column(A, 3))>; result := <Row(temp, 2), Row(temp, 3))>;

 

Surely there is a better way to do this?

Thanks!

 

Please Wait...