How to compare rows of a matric?

1 Ansicht (letzte 30 Tage)
Harsha M V
Harsha M V am 3 Sep. 2021
Bearbeitet: KSSV am 3 Sep. 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?

Akzeptierte Antwort

KSSV
KSSV am 3 Sep. 2021
Bearbeitet: KSSV am 3 Sep. 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.

Weitere Antworten (0)

Kategorien

Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by