HEEEEELP....... Array cells comparing....

Hello friends. i want to compare elements in two two arrays, one is big the other is smaller so i need to check if an individual element (say elements one of the smaller array) is available in the bigger one. Any one who can help me perform that job i would really appreciate.

6 件のコメント

Luna
Luna 2019 年 3 月 27 日
編集済み: Luna 2019 年 3 月 28 日
Moved this comment to answers.
Jan
Jan 2019 年 3 月 27 日
@Luna: If this is posted in the section for answers, I will vote for it.
EDEN
EDEN 2019 年 3 月 27 日
arr1=[2 1 4 1 5 9 2 6 5 3 5 8 9 7 9 ]
arr2=[2 ]
arr2 contains just one element '2'. we need to check if arr1 contains any number in arr2 and if yes we take it and save it in an other variable. that is precisely what i want.
Adam Danz
Adam Danz 2019 年 3 月 27 日
As Luna suggested, use ismember().
EDEN
EDEN 2019 年 3 月 27 日
thanks
Luna
Luna 2019 年 3 月 28 日
@Jan waiting for your +1 :)

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

 採用された回答

Luna
Luna 2019 年 3 月 28 日

1 投票

Hi,
Look at the function ismember to search if your element exists in another array.
Please share your arrays as an example and what have you done so far, and what kind of output you want to get. So that we can help.

2 件のコメント

Adam Danz
Adam Danz 2019 年 3 月 28 日
+1
Luna
Luna 2019 年 3 月 29 日
Thanks @Adam :)

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

質問済み:

2019 年 3 月 27 日

コメント済み:

2019 年 3 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by