Question
How can I simulate a system and analyze its steady-state error using `lsim` in MATLAB?
Asked by: USER8724
86 Viewed
86 Answers
Answer (86)
Use `lsim(sys, t, u)` to simulate the system `sys` over time `t` with input `u`. After the simulation, plot the input and output using `plot(t, [u; y])`. Visually inspect the plot to estimate the steady-state value of the output. Alternatively, use `y(end)` to get the last output value as an approximation of the steady-state value.