Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

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 visualizzazione (ultimi 30 giorni)
[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

Risposte (0)

Questa domanda è chiusa.

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by