How to apply or operator on the components of a vector?

조회 수: 2 (최근 30일)
Andre Ged
Andre Ged 2022년 11월 3일
댓글: Andre Ged 2022년 11월 3일
Hello,
how can I apply the operator or || to the components of a vector v = [v(1) v(2) v(3)...v(n)], whose size is not known a priori, i.e.
v(1) || v(2) || v(3) || ... || v(n) with a general value of n.
Thanks

채택된 답변

Jan
Jan 2022년 11월 3일
편집: Jan 2022년 11월 3일
any(v)
% If n is not the number of elements:
any(v(1:n))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by