commands → submatrix

submatrix(A,i,j,k,l)

The submatrix command constructs a new matrix from rows i to j and columns k to l of a matrix A.

Examples

A = [[1,2,3,4], [5,6,7,8], [9,10,11,12]];
submatrix(A,1,2,3,4);
	[[3, 4], [7, 8]]