MATLAB: How to generate the impulse response of a linear or nonlinear system using MATLAB, SIMULINK, impulse, lsim, or ode45

Control System ToolboxSimulink Control DesignSimulink Response Optimization

I would like to generate the impulse response of a linear or nonlinear system using MATLAB, SIMULINK, impulse, lsim, or ode45.
I also wonder if there are any examples showing how to generate an impulse response.

Best Answer

Note:
In Release 14, Control System Toolbox linearization features for Simulink have been extensively enhanced and moved to a new product named Simulink Control Design. The linearization features are no longer available in the Control System Toolbox. For more information, see the following:
If you are using an earlier version, see the following:
The secret to obtaining impulse responses lies in using the initial conditions that arise from impulse input. This approach is outlines in the attached Tech Note 1901, "How Do I Obtain an Impulse Response?"
Related Question