MATLAB: Error: Variable “checkVar” might be set by a nonscalar operator.

MATLAB and Simulink Student Suitenonscalar

The variable checkVar is a double and I want the program to enter the while loop when checkVar does not equal 0.0345. I receive an error saying: Variable "checkVar" might be set by a nonscalar operator.
while (checkVar ~= 0.0345)
messageOut=combineVar;
end

Best Answer

Replace this line:
comparitorIn =(comparitorOutDec./comparitorInDec);
with
comparitorIn =(comparitorOutDec/comparitorInDec);
Actually the original line gives a vector output......and the condition in while loop is a expecting a scalar value. So the error.