Conditional Statements Between Two Arrays

2 ビュー (過去 30 日間)
Nathaniel Wolff
Nathaniel Wolff 2019 年 12 月 11 日
コメント済み: Nathaniel Wolff 2020 年 8 月 19 日
I am trying to compare each value between two large arrays then store true values as another array. What do I type?
  2 件のコメント
Ruger28
Ruger28 2019 年 12 月 11 日
What have you tried?
Nathaniel Wolff
Nathaniel Wolff 2019 年 12 月 11 日
If (x>y) %I don't know how to list the true statement as a new variable End

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

採用された回答

Ruger28
Ruger28 2019 年 12 月 11 日
a = 1:100;
b = 1:2:100;
c = ismember(a,b); % index of values of array a inside of array b
d = a(c); % the values inside of a that are in b
  1 件のコメント
Nathaniel Wolff
Nathaniel Wolff 2020 年 8 月 19 日
thank you

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by