Check for missing argument or incorrect argument data type in call to function 'ilaplace'.

16 views (last 30 days)
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!!

Accepted Answer

Ameer Hamza
Ameer Hamza on 13 Sep 2020
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

More Answers (2)

vissia volpe
vissia volpe on 21 Nov 2020
I run my program, but i have a problem instruction ilaplace .
"Check for missing argument or incorrect argument data type in call to function 'ilaplace'.
Error in s229562_Es1 (line 56)
Y=ilaplace(g)"
the program is:
a=2;
b=2;
c=7;
d=9;
e=6;
f=2;
syms s tau1 tau2 k1 k2
tau= a+b+c+d+e+f
K= a+b+c+d*0.1+e*0.01+f*0.001
k1=1/(1+K*tau)
k2=1/(1+K*tau)
tau1=tau/(1+K*tau)
tau2=tau/(1+K*tau)
num=[k1*k2];
den=[tau1*tau2,tau1+tau2, 1];
disp("QUESTA E' LA FUNZIONE DI TRASFERIMENTO:")
G=tf(num, den)
disp("ZERI DELLA MIA FDT:")
zero(G)
disp("POLI DELLA MIA FDT:")
p=pole (G)
disp("GUADAGNO STATICO DELLA MIA FDT:")
z=dcgain(G)
%PUNTO_3 DISEGNO DEL GRAFICO DELLA RISPOSTA
A=-1; %ampiezza della mia variazione a gradino
disp('FDT SOGGETTA AD UN DISTURBO A GRADINO DI AMPIEZZA A=-1:')
g=G*A
step(g)
title('RISPOSTA AD UN IMPULSO A GRADINO DI AMPIEZZA A=-1')
%calcolo dell'antitrasformata
disp("ANTITRASFORMATA DI LAPLACE:")
Y=ilaplace(g)

seniha yildirim
seniha yildirim on 13 Sep 2022
function [a,b] = dft(x)
N= length(x);
n=1:N-1;
t = 2 * pi * (0:(n-1))/N;
for k=1:N
n=1:N-1;
fa= x(n) .* cos(2*pi*n/N);
fb =x(n) .* sin(2*pi*n/N);
a(k) = (2/N) * symsum (fa, n, 0, N-1);
b(k) = (2/N) * symsum (fb, n, 0, N-1);
x = @(t)a/2 + symsum((ak*cos(2*pi*k*n/N))+(bk*cos(2*pi*k*n/N)),k,1:k);
end
end
Can you help me please, it gives error of 'Check for incorrect argument data type or missing argument in call to function
'symsum'.
Error in dft (line 9)
a(k) = (2/N) * symsum (fa, n, 0, N-1);'

Community Treasure Hunt

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

Start Hunting!