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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by