Matlab Dimpulse function documentaion not found

16 views (last 30 days)
I was using the dimpulse function in one ofthe codes for digital signal processing. It is working properly. But I couldn't find the documentaion for the function. Here is my code:
n=0:10;
% impulse response of first order system
% y(n)-0.9*y(n-1)=2*x(n)
b=[2 0 0];
a=[1 -0.9 0];
y=dimpulse(b,a,length(n));
subplot(2,1,1);
stem(n,y);
xlabel('n--->');
ylabel('amplitude');
title('impulse response of first order system');
% impulse response of second order system
% y(n)+0.6*y(n-1)+0.8*y(n-2)=x(n)
b=[1 0 0];
a=[1 0.6 0.8];
y1=dimpulse(b,a,length(n));
subplot(2,1,2);
stem(n,y1);
xlabel('n---->');
ylabel('amplitude');
title('impulse response of second order system');

Answers (2)

John D'Errico
John D'Errico on 25 Feb 2025
It seems dimpulse (or at least one version thereof) can be found in the control TB.
which dimpulse -all
/MATLAB/toolbox/control/ctrlobsolete/dimpulse.m
However, given the location, my guess is it may be considered obsolete. As such, the docs for dimpulse may be missing.
And there are also at least a few universities who have written their own version of dimpulse.
But the help for dimpulse (the control TB version) can be found as:
help dimpulse
DIMPULSE Impulse response of discrete-time linear systems. DIMPULSE(A,B,C,D,IU) plots the response of the discrete system: x[n+1] = Ax[n] + Bu[n] y[n] = Cx[n] + Du[n] to an unit sample applied to the inputs IU. The number of points is determined automatically. DIMPULSE(NUM,DEN) plots the impulse response of the polynomial transfer function G(z) = NUM(z)/DEN(z) where NUM and DEN contain the polynomial coefficients in descending powers of z. DIMPULSE(A,B,C,D,IU,N) or DIMPULSE(NUM,DEN,N) uses the user- supplied number of points, N. When invoked with left hand arguments, [Y,X] = DIMPULSE(A,B,C,D,...) [Y,X] = DIMPULSE(NUM,DEN,...) returns the output and state time history in the matrices Y and X. No plot is drawn on the screen. Y has as many columns as there are outputs and X has as many columns as there are states. See also IMPULSE, STEP, INITIAL, LSIM.

Sam Chak
Sam Chak on 25 Feb 2025
For your information, the current version of the impulse() function can be applied to both continuous-time and discrete-time LTI models generated using the tf(), zpk(), or ss() commands.
A = [1.6 -0.7;
1.0 0.0];
B = [0.5;
0.0];
C = [0.1 0.1];
D = 0.0;
Ts = 0.2; % sampling time
sys = ss(A, B, C, D, Ts);
impulse(sys), grid on

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!