MATLAB: Elementwise Multiplication (Dot Multiplication) of Matrices

arraydotelementelementwisematrixmultiplication

I am an instructor of MATLAB at a university. And we traditionally taught that for element-wise multiplication to work, both dimensions (row and column number) of each matrices must be exactly the same. For instance, you could multiply a 1×3 array with another 1×3 array, but not with a 4×1 array. And it used to be like that, otherwise, it would give an error, saying "matrix dimensions must agree".
I just noticed that at least in MATLAB 2017a, you actually can multiply various sizes of arrays element-wise. For example, you can multiply a 1×3 array with a 4×1 array, getting a 3×4 array. However, you still cannot element-wise multiply a 1×3 array with a say, 2×2 array. What is the rule for the dimensions when doing elemnent-wise multiplication there? And in which edition of MATLAB this change occurred?
Thank you.

Best Answer

It’s called ‘implicit expansion’, and was introduced in R2016b.
I can’t find a specific link to it. You can find it under Mathematics in the Release Notes (link) for R2016b.
Related Question