If we want to add 2 matrices in maths, their dimensions must be the same.
I believe most texts accept a slight generalization of that, to allow adding scalars to matrices that are not 1-by-1. Scalar expansion has been part of MATLAB for longer than I've been at MathWorks (nearly 20 years.) It's probably in Cleve's original Fortran MATLAB.
Implicit expansion is a generalization of that behavior. It avoids having to repmat the vectors to a common size we can compute, thus saving memory. After all, if A in my example above took up 1 GB of space (which would mean B would also take 1 GB of space) do you really want to have to allocate a temporary 1 GB matrix all of whose elements are 1?
Thanks a lot, but is this mathematically correct?
I won't tell the Mathematics Police if you don't.