This code produces this error of broadcasting and I don't understand why. N is a number, C is a matrix 4x4, xvec_tra an array 4x1 and the result x should be a matrix 4xN.

x=np.zeros(shape=(4,int(N)), dtype=np.float64)

for i in range(0, int(N/2)):

if i == 0:

x[:,0]=C * xvec_tra

print(x[:,0])

else:

x[:,i]=C*x[:,i-1]

print(x[:,i])