Doubt regarding Broadcast assignment of 1d Arrays and Vectors

I think the reason this happens is that the dimension check is tighter for assignment than all other operations. Since [1 2 3; 4 5 6] .+ [1; 2] works (expanding the 1 dimension result along the longer axis) the operation is defined for objects of different dimensions. For .=, however you have to store data so you can’t automatically expand along dimensions. As such, no equivilent method is defined to allow .= for vectors and matrices

4 Likes