MATLAB: Operands to the || and && operators must be convertible to logical scalar values error

operands to the || and && operators must be convertible to logical scalar values error

I get an operators error… Not sure why. Can you help out?
Here is the code:
while count<=i
mfg=G(count)
if mfg == 27 && mfgdate2 >= 1946 && mfgdate<= 1974 || mfg == 27 && mfgdate>= 1983 && mfgdate<= 1988
MfgScore(count,:)=3;
end
count=count+1;
end

Best Answer

Either mfgdate or mfgdate2 are not scalar. You probably need to index them with count
It is suspicious that you use mfgdate2 only once in the expression
Related Question