Define range of values from an array
3 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
採用された回答
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 ?
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!