The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Or statement not behaving properly?
Replies: 3   Last Post: May 2, 2012 9:44 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 3
Registered: 5/2/12
Or statement not behaving properly?
Posted: May 2, 2012 6:54 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello all,
I have what I think is an easy question, but apparently I just can't see what is incorrect (perhaps it is too late).
I think that the OR operator is not working correctly. If I type in the following, I get:
>> b
b =
>> b == (2 || 5)
ans =
>> b == or(3,5)
ans =
Why is this returning 0? b does infact equal 5. So why does it return zero, ie false?

I have a feeling the answer is incredibly simple, but for the life of me I can't see it.
Any help is appreciated.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.