I want to use inverse laplace with tf function. How can I do it? I take an error in matlab when ı use code like below.

4 views (last 30 days)
A=[-2 0 ; 0 -1]
B=[1;2]
C=[1 1]
D=0;
P=ss(A,B,C,D)
syms s
F=tf(P)
ilaplace(F)

Accepted Answer

Star Strider
Star Strider on 16 Dec 2018
Try this:
A=[-2 0 ; 0 -1]
B=[1;2]
C=[1 1]
D=0;
P=ss(A,B,C,D)
syms s t
F=tf(P)
num = poly2sym(F.Numerator, s)
den = poly2sym(F.Denominator, s)
f(t) = ilaplace(num/den)
figure
fplot(f, [0,10])
grid
producing:
num =
3*s + 5
den =
s^2 + 3*s + 2
f(t) =
2*exp(-t) + exp(-2*t)
and the plot.

More Answers (1)

madhan ravi
madhan ravi on 16 Dec 2018
  1 Comment
caglar karabacak
caglar karabacak on 16 Dec 2018
Thank you I tried this code. My function doesnt have num and den varialbles. I tried to convert this code for my function but it doesnt work please help me .

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!