필터 지우기
필터 지우기

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 CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by