Azzera filtri
Azzera filtri

How to compare rows of a matric?

2 visualizzazioni (ultimi 30 giorni)
Harsha M V
Harsha M V il 3 Set 2021
Modificato: KSSV il 3 Set 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?

Risposta accettata

KSSV
KSSV il 3 Set 2021
Modificato: KSSV il 3 Set 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.

Più risposte (0)

Categorie

Scopri di più su Shifting and Sorting Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by