I was hoping that this would work for centering some data that is e.g.
d = [rand(2) for i=1:10] d - mean(d)
or even the broadcasting version
d .- mean(d)
But they don’t work. I understand why they don’t work, but I’m wondering if it would be possible to have consistent broadcasting rules that would make it work.
For now, I know I can do
d .- [mean(d)]
It is just that with scalar elements, one can write
d = rand(10) d - mean(d)