Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

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. If there are more than one with the same maximum sum, the function can pic

1 visualización (últimos 30 días)
[rows, columns] = size(A);
overallMaxSum = -inf;
for smColumns = 1 : columns
for smRows = 1 : rows
sumMatrix = conv2(inputMatrix, ones(smRows, smColumns), 'same');
maxValue = max(sumMatrix);
if maxValue > overallMaxSum
numrows = smRows;
numcols = smColumns;
end
end
end

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by