Recently, a function called MATLAB was added to R2016b, which causes a lot of headaches in the school I teach.
Nowadays, formulas that are traditionally considered illegal or at least shadow mathematicians are successfully executed:
[1, 2] + [3, 4]' -> [4, 5; 5, 6] [1, 2]' + [3, 4, 5] -> [4, 5, 6; 5, 6, 7]
Thus, adding a row vector to a column vector is considered as adding two matrices, which can be obtained from repeating vectors to βsuitableβ sizes. In older versions, this would lead to an error message indicating that adding matrices with different sizes is not possible.
I think that asking why is a little wide, although if you know why, I would like to know. Instead, I will ask: is there a way to disable this functionality ? For novice programmers, this is a world of pain when ordinary math does not seem to be in the queue, and the resulting matrix often goes unnoticed, causing errors only later.
I do not see that this is a useful part of the syntax and behavior of MATLAB, since it requires too much interpretation, reading in the programmer's intentions. repmat exists for some reason, and a special function can be introduced to satisfy the need for this thing.