フィルターのクリア

How to Shorten This Logical Expression?

3 ビュー (過去 30 日間)
Rightia Rollmann
Rightia Rollmann 2016 年 8 月 14 日
回答済み: Azzi Abdelmalek 2016 年 8 月 14 日
What is the best way to rewrite A in the shortest way?
B = 1:14;
A = B == 1 | B == 2 | B == 3 | B == 7 ;

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 8 月 14 日
A = ismember(B,[1 2 3 7])

その他の回答 (1 件)

Image Analyst
Image Analyst 2016 年 8 月 14 日
How about
A = B <= 3 | B == 7 ;

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by