Recently, in R2016b a feature was added to MATLAB, which is causing a lot of headaches in the school where I teach.
Nowadays formulae, which traditionally would be c
This feature was introduced in Matlab R2016b. In older versions, this expansion had to be done either with repmat
or with bsxfun
. Newer versions feature this implicit expansion of dimensions to vectorize the calculation.
In this blog post Steve Eddins, from MathWorks says that:
Other people thought that the new operator behavior was not sufficiently based on linear algebra notation. However, instead of thinking of MATLAB as a purely linear algebra notation, it is more accurate to think of MATLAB as being a matrix and array computation notation.
and it really does make sense in a computational context. I can say that for my uses, this implicit expansion does make things easier very often.
Of course, seeing this from the point of view of algebra, it doesn't make sense. But if you think about it, most computer language notation wouldn't make sense.
And since this is now part of the language, it shouldn't be possible to disable the feature (until Yair Altman tries to do so :P
).