Broadcast implementation

Use data .- centroids[1, :]' to transpose centroids[1,:] to a 1 \times 2 row vector.

See also Unintuitive Julia result: selecting a row from a matrix

4 Likes