Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Babak
Posts:
9
Registered:
7/12/13


3 condition in IF statement
Posted:
Jul 30, 2013 3:40 PM


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
clc clear all f1=3;f2=3;THD=2; if ((0>=f1<=2) && (4>=f2<=5) && (1>=THD<=6)) disp('Normal)') elseif (0>=f1<=3) && (1>=f2<=5) && (1>=THD<=6) disp('Sag') end
In this program it will always shows "Normal" because of the last condition (1>=THD<=6)! Where I went wrong?



