How to sum the minor number of each line in a matrix?

2 visualizaciones (últimos 30 días)
Carolina Silva
Carolina Silva el 20 de Nov. de 2019
Respondida: Erivelton Gualter el 20 de Nov. de 2019
The question its in the title, thanks

Respuestas (1)

Erivelton Gualter
Erivelton Gualter el 20 de Nov. de 2019
Given matrix A as:
A = [9 6 3;
8 5 2;
7 4 1]; % Sample Matrix
minA = min(A,[],2); % Returns min value for each line (row)
sumMinA = sum(minA); % Returns the sum of the min values

Categorías

Más información sobre Numeric Types en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by