My code works fine with '==' but not with '~='.I expect it not to display 'error' if user enters A or B
x=input('input x','s') if(x~='A')||(x~='B') disp('error'); end
avoid overfittingif statementMATLAB
x=input('input x','s') if(x~='A')||(x~='B') disp('error'); end
Best Answer