How to Shorten This Logical Expression?
Show older comments
What is the best way to rewrite A in the shortest way?
B = 1:14;
A = B == 1 | B == 2 | B == 3 | B == 7 ;
Accepted Answer
More Answers (1)
Image Analyst
on 14 Aug 2016
How about
A = B <= 3 | B == 7 ;
Categories
Find more on Modeling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!