Questions tagged [submatrix]

A submatrix is a matrix formed by selecting a subset of the rows and columns of one larger matrix. Questions tagged [submatrix] deal with implementation issues regading accessing the relevant rows/columns of the larger matrix, relevant memory issues, etc.

A submatrix is a matrix formed by selecting a subset of the rows and columns of one larger matrix.

For example, let A be a matrix of size n-by-m

A = [ a00 a01 ...
      a10 a11 ...
      .       .
      .        .
      .         .
      an1 an2 ... anm ]

Then one can form a 2-by-3 sub-matrix by selecting rows 2 and 5, and columns 1,4 and 6.
The resulting sub-matrix is then

S = [ a21 a24 a26
      a51 a54 a56 ]

Questions tagged [submatrix] deal with implementation issues regading accessing the relevant rows/columns of the larger matrix, relevant memory issues, etc.

183 questions
-2
votes
1 answer

Write an OCaml program which checks whether the matrix A is contained in the matrix B

Despite not encountering any major problems with Java, I cannot say so regarding the OCaml programming language. I am supposed to create a function subMat which for two matrices, checks if matrix A is a submatrix of matrix B, and if so - returns…
-3
votes
3 answers

How to get all submatrixes(2x2) from any square matrix using function and then make a new matrix with maximum values from the submatrixes

For example I have this matrix(3x3) and I want to make a new 2x2 matrix with the max values from all the submatrixes : = [ 5 4 6 3 2 3 8 8 9 first submatrix: [5 4 3 2 ] max value=5 second submatrix: [4 6 2 3] max…
-3
votes
1 answer

how to find a submatrix with primes in matlab

Enter n: 3 Enter range: 50 // range of prime numbers A = 1 12 37 24 45 11 2 34 10 matrix sum = 48 solution submatrix = 37 //largest rectangle of primes 11 coordinates are= 1 3 2 3 First program gives a…
1 2 3
12
13