Should I use "bsxfun" or implicit expansion?

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

 Accepted 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.

1 Comment

Note that until R2021a
bsxfun
is still needed in case you want to generate C/C++ code

Sign in to comment.

More Answers (0)

Categories

Find more on Elementary Math in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!