finding a row in matrix

a=[1 2 3;5 8 9 ;5 6 4;1 2 5] I want to check whether a contains [5 6 4] in any row or not. How can I do this?

 Risposta accettata

KSSV
KSSV il 1 Nov 2017
Modificato: KSSV il 1 Nov 2017
Read about ismember
a=[1 2 3;5 8 9 ;5 6 4;1 2 5] ;
b = [5 6 4] ;
idx = find(ismember(a,b,'rows'))

Più risposte (0)

Categorie

Scopri di più su Get Started with MATLAB in Centro assistenza e File Exchange

Prodotti

Richiesto:

il 1 Nov 2017

Modificato:

il 1 Nov 2017

Community Treasure Hunt

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

Start Hunting!

Translated by