Is matrix multiplication not associative?

The issue is that [1 2] is a matrix, not a row vector, so [1 2] * [1; 2] returns a vector of length one, not a scalar. To get a row vector, type [1; 2]' or transpose([1; 2]) or adjoint([1; 2]).

julia> let
           B = [1; 1]
           K = [1; 2]'
           x = [1; 2]

           @show (B * K) * x # Works fine
           @show B * (K * x) # Works fine
       end;
(B * K) * x = [5, 5]
B * (K * x) = [5, 5]