Hi there,
I want to make an if statement with the following format: There are only four allowed states, (1,0) (-1,0) (0,-1) (0,1). The code below is what I have setup and I need someway to convert the second into a NOT (this) statement, it is currently a (this) statement. I mean that aside from those four states, nothing else is allowed. For interest there are 9 combinations possible with 4 allowed for 2 inputs (3^n rule). Thank you for the help.
if UD ~= -1 || UD ~= 0 || UD ~= 1 || LR ~= -1 || LR ~= 0 || LR ~= 1 error('UD/LR must either -1, 0 or 1');elseif UD == 1 && LR == 0 || UD == -1 && LR == 0 || UD == 0 && LR == -1 || UD == 0 && LR == 1 error('UD/LR must be some combination of -1, 0 and 1');end
Best Answer