문제

How do I apply logical operators to a Matlab array in a "sum" fashion?

For example : and([1 0 0]) = 0, and([1 1 1]) = 1.

도움이 되었습니까?

해결책

If you have:

a = [1,0,0]

then you can say:

any(a) %% which is equivalent to 'or'

all(a) %% which is equivalent to 'and'
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top