M and K are always NxN. C is always NxM. Thus A is NxN and B is NxM
x_dot=M\K*x + M\C*u
The “A” matrix is the relationship between states and their time derivatives (continuous model) or the current states and the states at the next time step (discreet model). “B” is the input matrix to the system.