필터 지우기
필터 지우기

Comparing Two Different Arrays

조회 수: 3 (최근 30일)
Serra Aksoy
Serra Aksoy 2020년 2월 4일
댓글: Serra Aksoy 2020년 2월 4일
Hi,
I have two arrays: A=[ 10 20 30 40 50 ] and B=[ 12 22 32 42 52 ]
Here the min(A)= 10 and the max(A)=50
Let's take b ∈ B.
I would like to find the elements of B that satisfy the following condition: min(A) < b < max(A)
If an element of B satisfy this condition it should be 1 in a new array X , if it does not satisfy this condition it should be 0 in a new array X.
So in this example i need an array like : X=[ 1 1 1 1 0 ]
Any help is appreciated.

채택된 답변

Bhaskar R
Bhaskar R 2020년 2월 4일
X = B>min(A) & B<max(A);
  댓글 수: 1
Serra Aksoy
Serra Aksoy 2020년 2월 4일
Thanks for your answer.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by