Confusing broadcast behavoir

All of those are expected.

But I’m curious: what were you expecting this

to do? The @. macro adds dots to all operators and function calls, but here there are none. Clearly, this is identical to

b = a

which is just ordinary assignment.

The second one

is equivalent to

b .= a

which does elementwise copying.

5 Likes