MATLAB: Should I use “bsxfun” or implicit expansion

bsxfunexpansionimplicit

Which one is better, "bsxfun" or implicit expansion whenever possible?

Best Answer

It is now recommended that you replace most uses of bsxfun with direct calls to the functions and operators that support implicit expansion. Compared to using bsxfun, implicit expansion offers faster speed of execution, better memory usage, and improved readability of code.