Matrix Logical Indexing in If...else... construction
조회 수: 1 (최근 30일)
이전 댓글 표시
Pavel M
2019년 12월 15일
답변: Thiago Henrique Gomes Lobato
2019년 12월 15일
How i can do condition then if in my array varargin{j} at least one logical '1' is exist, condition works?
example
elseif varargin{j} == inf | varargin{j} == 0 | varargin{j} < 0
error(..)
댓글 수: 0
채택된 답변
Thiago Henrique Gomes Lobato
2019년 12월 15일
If you wanna check that a condition happens at least one time in an array you can use "any"
elseif any(isinf(varargin{j})) || any(varargin{j} <= 0)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!