How to Shorten This Logical Expression?

What is the best way to rewrite A in the shortest way?
B = 1:14;
A = B == 1 | B == 2 | 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!