MATLAB Examples

Simulate LTI Model in Simulink

The LTISystemBlockSimulation model shows how to use an LTI System block to simulate the response of a SISO transfer function to a step input.

To specify a model for the LTI System block, set the LTI system variable block parameter to either:

  • The variable name of an LTI model in the MATLAB® workspace or model workspace, such as sys.
  • A MATLAB expression that evaluates to an LTI model, such as tf(1,[1 1]).

For example, you can specify a state-space (ss), zero-pole-gain (zpk), or transfer function (tf) model. You can simulate SISO models or MIMO models, and continuous-time or discrete-time models.

In LTISystemBlockSimulation model, the LTI system variable parameter is a MATLAB expression, tf(1,[1 2 5]), which creates a continuous-time SISO transfer function. If the specified system is a state-space (ss) model, then you can specify initial state values by setting the Initial states parameter.

Simulate the model, and examine the result in the scope.

This example simulates the system response to a step input at t = 2 s. Use the LTI System block to import an LTI model object anywhere in your Simulink model to simulate the linear system response to any input.