MATLAB: Incorrect matrix substitution with ML2016b

MATLAB and Simulink Student Suitematrix

(Matlab2016b-student) I had to substitute an (4×1)-Matrix with a (4×4)-Matrix. The result should have been a failure, instead it gave me a (4×4)-Matrix as output. How is this possible, when it is mathematical incorrect? In version Matlab2015b it gave the "correct" output that it's a failure because of the different matrix dimensions.

Best Answer

You don't show your code, but my guess is you did one of the element-wise operations that now has scalar expansion built in. E.g.,
(4x4) + (4x1)
The above will fail in earlier versions of MATLAB, but in R2016a it is automatically done as if you had invoked the bsxfun function with the @plus operation. See this link under "Implicit Expansion":
https://www.mathworks.com/help/matlab/release-notes.html