This error is seen if the operands being evaluated by the short-circuit || and && operators are empty or non-scalar arrays. If yes, please use the logical and (&), or (|) operators for those non-scalar operands.
One way to verify this could be to identify the line which is throwing this error. You can do so as folllows:
1) You can halt the execution of the code at the point when the error occurs by using the following command in MATLAB.
>> dbstop('if','error')
2) Once the above command is executed, execute the MATLAB script / function in the same command Window. For example
>> sample_script.m
3) Now the execution will halt at the line in the script which throws error. Please confirm if any of the operands used by || or && in this line is non-scalar (by checking the value of the operand variables in the MATLAB workspace).