Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何以“求和”方式将逻辑运算符应用于 Matlab 数组?
例如:and([1 0 0]) = 0, and([1 1 1]) = 1。
如果你有:
a = [1,0,0]
那么你可以说:
any(a) %% which is equivalent to 'or' all(a) %% which is equivalent to 'and'