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?

 採用された回答

KSSV
KSSV 2017 年 11 月 1 日
編集済み: KSSV 2017 年 11 月 1 日

1 投票

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB についてさらに検索

製品

タグ

質問済み:

2017 年 11 月 1 日

編集済み:

2017 年 11 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by