octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Matlab and broadcasting


From: Rik
Subject: Matlab and broadcasting
Date: Wed, 30 Aug 2017 14:47:16 -0700

I wasn't following things, but apparently since 2016B broadcasting is now a part of Matlab (Octave was here first!).  For example, in the documentation for bsxfun, there is now this

"In MATLAB® R2016b and later, you can directly use operators instead of bsxfun, since the operators independently support implicit expansion of arrays with compatible sizes."

Seems like a good project might be to review Octave's m-file scripts to see if there are places where we are unnecessarily using repmat or ones() in order to create correct dimensions when broadcasting would take care of this and not involve the creation of potentially large temporary variables.

Unfortunately, I see that broadcasting is still not as good as bsxfun for all implementations.  There is this comment in center.m

## FIXME: Use bsxfun, rather than broadcasting, until broadcasting
##        supports diagonal and sparse matrices (Bugs #41441, #35787).

--Rik





reply via email to

[Prev in Thread] Current Thread [Next in Thread]