フィルターのクリア

How to find the common values in two arrays

813 ビュー (過去 30 日間)
Jisha
Jisha 2012 年 5 月 28 日
コメント済み: Dyuman Joshi 2024 年 5 月 8 日
Suppose I have two vectors
a= 1 2 3 4
b= 4 5 6 7 9
How do I find which value is common to both
in above case it is 4

採用された回答

Thomas
Thomas 2012 年 5 月 28 日
You need the intersect command
doc intersect
in your case
[val,pos]=intersect(a,b) % gives common val and its position in 'a'
  1 件のコメント
bhawya b
bhawya b 2022 年 11 月 28 日
Thanks!!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by