The problem is given in the title. My approach to this problem is like that:
- Create a binary matrix B where 1s represents the prime numbers in the input let say V, which is nxn non negative integer matrix
- Find all the positive submatrices including 1x1 fom B
- Find the sum of them and return the greatest one with the left top corner of the submatrix and the size of it.
In this sense, section 2 of my algorithm seems a little complicated. Is there any way to find them without the brute force, which is I think, iterating via for loops and finding them. I am hoping that matlab has a function returning what I want.
Any help is appreciated.