Error plotting inverse laplace in time domain

Hi
I'm trying to plot a transfer function by first converting it to the time domain. So my laplace function and code is:
syms s
g=((s+5)/(s*(s+3)*(s^2+2*s+6)))
t=0:10; %time domain
a=ilaplace(g) %inverse
plot(t,a(t));
But doing this gives me an error:
??? Error using ==> sym.subsref at 40
Error using ==> maplemex
Error, (in MTM:-subsref) Array index out of range
Error in ==> Untitled4 at 7
plot(t,a(t));
Can someone please tell me what I'm doing wrong?

Answers (1)

perhaps try
plot(0:10,subs(a,0:10));

2 Comments

I tried but it get an error message:
??? Error using ==> sym.subs at 54
Error using ==> maplemex
Error, (in MTM:-subs) invalid input: exp expects its 1st argument, x, to be of type algebraic,
but received Vector[row](11, [0,-3,-6,-9,-12,-15,-18,-21,-24,-27,-30])
I don't have an issue, but I am using Mupad as the symbolic engine
a =
5/18 - (11*(cos(5^(1/2)*t) + (23*5^(1/2)*sin(5^(1/2)*t))/55))/(54*exp(t)) - 2/(27*exp(3*t))
y = subs(a,(0:10))'
y =
0.0000
0.2652
0.3092
0.2646
0.2795
0.2788
0.2771
0.2780
0.2778
0.2777
0.2778

Sign in to comment.

Asked:

R J
on 27 Nov 2011

Community Treasure Hunt

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

Start Hunting!