MATLAB: How to extract numerator and denominator as polynomials from a transfer function

dynamic systemnumerator and denominatortftransfert function

I'm am having some stupid trouble with transfer functions.
If I have to write the tf:
s^2 + 2 s
G(s) = ---------------------
s^3 - 2 s^2 + 4 s + 1
I could write: G=tf([2 1 0],[1 -2 4 1])
But now, I would like to extract numerator and denominator as array. If I write: [Num, Den]=tfdata(G) the programm gives me them as cells
Num =
cell
[1×4 double]
Den =
cell
[1×4 double]
How can I take numerator and denominator as arrays? I would like to receive
Num =
[2 1 0]
Den =
[1 -2 4 1]
Thank you

Best Answer

Just do this:
G = tf([2 1 0],[1 -2 4 1]);
[num den] = tfdata(G, 'v');
num =
0 2 1 0
den =
1 -2 4 1