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?