How can I convert a transfer function into time dependent using ilaplace

I have tried to use ilaplace
X2=(F*G3+C*G3)/(1+C*G3); % F,G3,C are transfer functions generated using tf
v=sym('X2');
x=ilaplace(v);
then i use it to plot a function using plot but when i try to run the code i get an error as shown below
??? The following error occurred converting from sym to double: Error using ==> mupadmex Error in MuPAD command: DOUBLE cannot convert the input expression into a double array.

Answers (1)

The ilaplace function works on symbolic expressions and not transfer function models. You need to convert the transfer function, X2, into a symbolic expression prior to using the ilaplace function.
Here are some links to some relevant functions:
To get you started, here is some example code of one potential method of conversion:
% Your transfer function model
X2 = (F*G3+C*G3)/(1+C*G3);
% Extract the numerator/denominator
[num,den] = tfdata(X2);
% Build symbolic expression using the numerator/denominator
syms s
arrayNum = cell2mat(num);
arrayDen = cell2mat(den);
X2_symbolic = poly2sym(arrayNum,s)/poly2sym(arrayDen,s);
% Valid usage of ilaplace on a symbolic
x = ilaplace(X2_symbolic);

Asked:

on 17 Oct 2013

Commented:

on 28 Feb 2014

Community Treasure Hunt

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

Start Hunting!