You can do everyting you want in a fairly straightforward fashion. There are probably different ways to achieve your ultimate goal, but this is how I would do it.
The Symbolic Toolbox normalises and simplifies your function, and puts them in descending powers of z.
After that, the numden function is your friend here: syms z
f = (1+z^-1+z^-2+z^-3)/(1-(0.18*z^-1)+(0.81*z^-2))
[nf, df] = numden(f)
yields:
nf =
100*z^3 + 100*z^2 + 100*z + 100
df =
z*(100*z^2 - 18*z + 81)
tfn = sym2poly(nf)
tfd = sym2poly(df)
yield:
tfn =
100.0000e+000 100.0000e+000 100.0000e+000 100.0000e+000
tfd =
100.0000e+000 -18.0000e+000 81.0000e+000 0.0000e+000
then create your transfer function with tf:
yields:
H =
100 s^3 + 100 s^2 + 100 s + 100
-------------------------------
100 s^3 - 18 s^2 + 81 s
Continuous-time transfer function.
NOTE: Your code specified a discrete-time transfer function, but tf will only provide that if you specify a sampling period, Ts, in seconds (although you can set Ts to -1 to leave the sample time unspecified).
Best Answer