Binary Singleton Expansion Function
(Quaternion and octonion overloadings of standard MATLAB® function)
C = bsxfun(fun, A, B)
This function is provided in order to support certain MATLAB® functions, particularly var, std, cov and kron which use bsxfun to apply arithmetic operators to intermediate results. bsxfun was introduced in MATLAB® Version 7.4 (R2007a). Prior to that release the var, std and cov functions worked with quaternions, but the introduction of bsxfun broke this.
The implementation is fairly crude and may use considerable memory for large array inputs. This is not a fundamental issue, as there is scope in the code to perform the processing in chunks, to reduce memory use, and this may be done in a later release.