Then the answer is "For reasons not explained, combining an integer data type in an array with floating point data is defined by MATLAB to return an integer data type."

If I were to speculate, then I would speculate that it is to allow people to write expressions such as

J = J + 1

when J starts as an integer data type here, it would be surprising for the user for it to suddenly become a floating point data type because the "1" happens to be floating point. It would be a nuisance for the programmer to have to continually write things like

Because that's how MATLAB does it. If an integer is multiplied by a double, it gives a rounded integer result. Same thing if you combine them like you did. It does not promote the integer variable to the more general double like most languages, and like you would think - I don't know why, that's just the way it is. This was one of the most surprising things I learned when I was learning MATLAB. I can't find the explanation for this in the help - maybe someone else will say where it can be found.