- #1
brydustin
- 205
- 0
It seems as if combining == with logical or will always give True (1) or False (2) whenever you perform the simple check, its result is only dependent on choice of notation or(A,B) versus A||B (or A|B which is better for arrays, generally || is for single elements)
Is there something wrong? or am I totally missing something, thanks...
(source for equivalent notation: http://www.mathworks.co.uk/help/techdoc/ref/logicaloperatorselementwise.html)
>> 3 == 4|5
ans =
1
>> 3 == 4||5
ans =
1
>> 3 == 3||3
ans =
1
>> 3 == or(3,3)
ans =
0
>> 3 == or(-Inf,4)
ans =
0
>> 3 == or(2,3)
ans =
0
Is there something wrong? or am I totally missing something, thanks...
(source for equivalent notation: http://www.mathworks.co.uk/help/techdoc/ref/logicaloperatorselementwise.html)
>> 3 == 4|5
ans =
1
>> 3 == 4||5
ans =
1
>> 3 == 3||3
ans =
1
>> 3 == or(3,3)
ans =
0
>> 3 == or(-Inf,4)
ans =
0
>> 3 == or(2,3)
ans =
0