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)(adsbygoogle = window.adsbygoogle || []).push({});

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

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab Logical Or

Loading...

Similar Threads for Matlab Logical |
---|

MATLAB MATLAB: forces acting on an object |

MATLAB Matlab histogram |

MATLAB Sovling Bernoulli's differential equation in matlab? |

MATLAB Matlab-like software |

MATLAB Matlab data into bins |

**Physics Forums | Science Articles, Homework Help, Discussion**