In MATLAB, when is it optimal to use bsxfun?
There are three reasons I use bsxfun (documentation, blog link) bsxfun is faster than repmat (see below) bsxfun requires less typing Using bsxfun, like using accumarray, makes me feel good about my understanding of MATLAB. bsxfun will replicate the input arrays along their “singleton dimensions”, i.e., the dimensions along which the size of the array … Read more