Extract matrices from the descriptor state space model?

Hello all,
I am very new to Mathematica and my question might seem mundane. So, please bear with me.
I am trying to extract the descriptor state-space model matrices from a set of state space equations. I have already done this.

M = StateSpaceModel[stateequations, states, vin[t], outputequations, 
  t]

We know that the descriptor state space is of the form:

kx’[t]=ax[t]+bu[t]*

y[t]=cx[t]+du[t]

I am trying to extract the matrices k, a, b, c, d.

I have tried

A=M[[1]]
B=M[[2]]

and so on and have been unsuccessful and have no idea how to do it.

Can anyone help me with this?
Thanks in advance!

Kartikeya,

Use Normal[] to get the matrices.

For example,

{aa,bb,cc,dd}=Normal[M]

or

{aa,bb,cc,dd,ee}=Normal[M]

for a descriptor system.

Although I recommend avoiding variables starting with capital letters (such as M) because these are used internally by Mathematica. (Especially single letter names like E,I,C,D plus others)

Regards,

Neil

Mr. Neil Singer,

That worked like a charm!
Thank you very much!