Write a function called maxsubsum that takes a matrix a as


Write a function called maxsubsum that takes a matrix A as an input, computes the sum of elements in each of its submatrices, and finds the submatrix that has the maximum sum. (For the purposes of this exercise, we define a submatrix as a matrix formed by a contiguous set of elements of the original matrix.) If there are more than one with the same maximum sum, the function can pick any one of them. Note that the entire matrix is considered to be a submatrix of itself, but because some elements of the matrix may be negative, it may not have the maximum sum. The function is defined like this:function [row,col,numrows,numcols,summa] = maxsubsum(A)where row and col specify the indexes of the top left corner of the submatrix with the maximum sum, numrows and numcols are its dimensions, and summa is the sum of its elements.

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Write a function called maxsubsum that takes a matrix a as
Reference No:- TGS01174424

Now Priced at $40 (50% Discount)

Recommended (92%)

Rated (4.4/5)

A

Anonymous user

4/18/2016 3:44:44 AM

Get ready an assignment that involves to finds the submatrix that has the maximum sum Inscribe a function said maxsubsum which takes a matrix A as an input, computes the sum of elements in each of its sub matrices, and finds the submatrix that has the maximum sum. (For the purposes of this exercise, we define a submatrix as a matrix formed by a contiguous set of elements of the original matrix.) If there is more than one by the similar maximum sum, the function can pick any one of them. Note that the whole matrix is considered to be a submatrix of it, but as several elements of the matrix may be negative, it mayn’t have the maximum sum. The function is described like this: function [row, col, numrows, numcols, summa] = maxsubsum(A)where row and col state the indexes of the top left corner of the submatrix through the maximum sum, numrows and numcols are its dimensions, and summa is the sum of its elements.