minimum row value and return the row
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
azie
el 18 de Jul. de 2013
Respondida: Heba Khaled
el 16 de Mayo de 2021
i need to find a minimum row value in a matrix. eg
A=[12 64 76; 34 10 27; 9 8 20; 10 30 8]
And the desired output would be min value of row = [9 8 20] which is row number 3.
is there any function can do this? I noticed that min () function is used to find the minimum value in a row NOT minimum row value.
1 comentario
Matthew Anderson
el 23 de Feb. de 2016
This might be a little late, but the min(min()) function would do the trick
Respuesta aceptada
Teja Muppirala
el 18 de Jul. de 2013
Do you mean to say, you want the row with the minimum maximum value?
A=[12 64 76; 34 10 27; 9 8 20; 10 30 8];
[value,ind] = min(max(A,[],2));
A(ind,:)
ans =
9 8 20
Or
A = [ 7 9 5; 3 8 7; 4 5 6]
[value,ind] = min(max(A,[],2));
A(ind,:)
ans =
4 5 6
1 comentario
Más respuestas (3)
Roger Stafford
el 18 de Jul. de 2013
You have not told us what aspect of rows you are minimizing. I will guess you want the row index of the row with the least sum.
[c,ix] = min(sum(A,2));
The value 'c' is the minimum row sum and 'ix' is that row's index.
James Tursa
el 18 de Jul. de 2013
Editada: James Tursa
el 18 de Jul. de 2013
If you want row that contains the minimum value (it is not clear to me what "minimum row" means):
[x xi] = min(A(:));
xij = ind2sub(xi,size(A));
minrow = A(xij(1),:);
3 comentarios
James Tursa
el 18 de Jul. de 2013
Can you please define what "minimum row" means? What is the minimum row of the following matrix (and why)?
[ 7 9 5;
3 8 7;
4 5 6]
Heba Khaled
el 16 de Mayo de 2021
how to get the minimum value of particular rows in matlab
0 comentarios
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!