MATLAB: Check for missing argument or incorrect argument data type in call to function ‘ilaplace’.

"inverse laplace plot"

syms t s
num = [0 0 1 2 1]
den = [1 2 2 2 0]
sys=tf(num,den)
h=matlabFunction(ilaplace(sys))
t=1:0.01:20
plot(t,h(t))
xlabel('Time [sec]')
ylabel('y(t)')
I am trying to plot the inverse laplace of sys. But I can't solve the error, please help!!

Best Answer

tf() is from the control system toolbox, which is not directly compatible with the symbolic toolbox—following shows how to solve it using both approaches.
Using ilaplace (symbolic toolbox)
syms t s
num = [0 0 1 2 1];
den = [1 2 2 2 0];
hs = poly2sym(num, s)/poly2sym(den, s);
ht = ilaplace(hs);
tv = 0:0.01:20;
Hv = subs(ht, t, tv);
plot(tv, Hv);
Using control toolbox
num = [0 0 1 2 1];
den = [1 2 2 2 0];
sys = tf(num, den);
impulse(sys);
Output for both codes
Related Question