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?

 Accepted Answer

KSSV
KSSV on 1 Nov 2017
Edited: KSSV on 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'))

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Products

Asked:

on 1 Nov 2017

Edited:

on 1 Nov 2017

Community Treasure Hunt

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

Start Hunting!