MATLAB: Is there a function that let me turn a rational function to a polynomial in matlab

laplacesym2polytf

hi, im currently having problem with the tf function, im trying to use it but i get the following message:
and i know i need to change it to vector i was using sym2poly() function to get only the numeric values so i can use the tf function later, but the problem is that my numerator is a rational:
need to know if theres any way to change the rational to a polynomial form inside matlab
Main problem is i need to tf this:
Capture6.PNG
since the numerator is a rational cant use sym2poly() to get the numeric values and then apply the tf function.
please help!

Best Answer

You are not using the tf function correctly. You need to specify that ‘xi’ is a continuous-time transfer function first, then you can do everything you want. (I use my own transfer function here because you posted an image of your transfer function assignment, not your actual code.)
Example —
s = tf('s');
xi = (s^2 + 2*s + 1)/(s^3 - 1)
numerator = [xi.Numerator{:}]
denominator = [xi.Denominator{:}]
producing:
xi =
s^2 + 2 s + 1
-------------
s^3 - 1
Continuous-time transfer function.
numerator =
0 1 2 1
denominator =
1 0 0 -1
The documentation for the tf function explains all of this.