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?

 Akzeptierte Antwort

KSSV
KSSV am 1 Nov. 2017
Bearbeitet: KSSV am 1 Nov. 2017

1 Stimme

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'))

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Hilfe-Center und File Exchange

Produkte

Gefragt:

am 1 Nov. 2017

Bearbeitet:

am 1 Nov. 2017

Community Treasure Hunt

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

Start Hunting!

Translated by