Assigning matrices

In addition to the syntax error @lmiq noted above, see: Please read: make it easier to help you … in particular, quote your code and post runnable code snippets (e.g. provide values for M, nf, B, C, and D, even if they are just random numbers).