How to compare rows of a matric?

1 visualización (últimos 30 días)
Harsha M V
Harsha M V el 3 de Sept. de 2021
Editada: KSSV el 3 de Sept. de 2021
I have a 50x4 matrix.
Here, how to find a row that all its elements are greater than the other elements of the rows in that matrix?

Respuesta aceptada

KSSV
KSSV el 3 de Sept. de 2021
Editada: KSSV el 3 de Sept. de 2021
A = rand(1,3) ; % your row
B = rand(3) ; % Say complete matrix
idx = A > B ; % comapre
r = find(sum(idx,2)==3) % find which row is greater
Run a loop for each row.

Más respuestas (0)

Categorías

Más información sobre Shifting and Sorting Matrices 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