Clear Filters
Clear Filters

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

1 view (last 30 days)
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

Accepted Answer

Jan
Jan on 3 Nov 2022
Edited: Jan on 3 Nov 2022
any(v)
% If n is not the number of elements:
any(v(1:n))

More Answers (0)

Categories

Find more on Data Import and Analysis in Help Center and File Exchange

Tags

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!