MATLAB: Need help with Operands operators must be convertible to logical scalar values

logical scalarMATLABoperands

Receving this error:
Operands to the || and && operators must be convertible to logical scalar values.
Error in DriverProgram (line 59)
if x2 >= 0 && x2 <= 8
{code}
if x2 >= 0 && x2 <= 8
x2_double_prime = (w-d)/m;
else
x2_double_prime= (w-d-b-r)/m;
end

Best Answer

use & instead of &&