필터 지우기
필터 지우기

Define range of values from an array

조회 수: 4 (최근 30일)
Alessandro Ruda
Alessandro Ruda 2022년 2월 21일
댓글: Alessandro Ruda 2022년 2월 21일
Dear MatLab comunity,
I got an array (x) of angles ranging from -180 to +180 degrees. I have to define two vectors that include the following values:
Cis = all the values between -90 and 90
Trans = all the values below -90 and above +90
I did the following:
Cis = X((X > -90) & (X < 90));
Trans = (X(X > 90) & X(X < -90));
Problem: the first line (cis) works and the second line (trans) doesn't and gives me an empty set. What's the problem?
Thank you in advance,
Alessandro

채택된 답변

Walter Roberson
Walter Roberson 2022년 2월 21일
편집: Walter Roberson 2022년 2월 21일
Trans = X(X > 90 | X < -90);
Question: which one should include exactly -90 or exactly +90 ?
  댓글 수: 1
Alessandro Ruda
Alessandro Ruda 2022년 2월 21일
Thank you! That works fine! No one should include the -90 and/or +90 so I think is fine this way.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by