Is there an equivalent function of unit delay in matlab that I can use in M-files?

I would like to write a script M-file to simulate the time delay phenomenon of discrete dynamical system. To hold the feedback control signal at an arbitrary time delay, which is a multiple of sampled time, one can use either the z-1 or z-n module in simulink. Is there equivalent matlab functions that support such function that I can implement in M-files? Thanks in advance.

Answers (1)

Using Control System Toolbox you can specify a delay in your LTI system. You can then simulate the LTI system using commands such as step or lsim.
Example below. More info here.
s=tf('s');
sys_no_delay=1/(s+1);
sys_delay=sys*exp(-1*s); % 1 sec delay
step(sys_no_delay);
hold on;
step(sys_delay,'r');

Tags

Asked:

on 21 Oct 2013

Commented:

on 15 May 2021

Community Treasure Hunt

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

Start Hunting!