You can test it yourself by timing the functions. `zeros` tends to be faster, because the OS can return zero-initialized memory, but not one-initialized memory. This means that MATLAB must fill the `ones` array with values, but not the `zeros` array.
– Cris LuengoJun 04 '21 at 07:17
[This answer](https://stackoverflow.com/a/48724131/3978545) addresses timing for many different initialisation methods
– WolfieJun 04 '21 at 07:27