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

2 次查看(过去 30 天)
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 中查找有关 Data Import and Analysis 的更多信息

标签

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by