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: 3 condition in IF statement
Replies: 16   Last Post: Aug 1, 2013 12:52 PM

Advanced Search

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

Posts: 9
Registered: 7/12/13
3 condition in IF statement
Posted: Jul 30, 2013 3:40 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi everybody. I have program which 3 condition should be compare. I want this IF statement to be true only in the case where the first condition AND the second condition AND the third condition are all true simultaneously.
Thanks a lot

clear all
if ((0>=f1<=2) && (4>=f2<=5) && (1>=THD<=6))
elseif (0>=f1<=3) && (1>=f2<=5) && (1>=THD<=6)

In this program it will always shows "Normal" because of the last condition (1>=THD<=6)!
Where I went wrong?

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.