FUNCTION REFERENCE
lsim
Simulate an LTI model with sampled inputs.
Simulate an LTI model with sampled inputs.
Syntax
[y,t,x] = lsim(sys,u,t[,x0][,'zoh'|'foh'])Syntax
lsim(sys1,sys2,...,u,t[,x0][,'zoh'|'foh'])Each row of u is a time sample and each column is an input. SISO input may also be a row vector. The default initial state is zero. y and x have one row per time, and columns for outputs and states. Without outputs, plots y with one axes per output. Continuous ZOH holds u(k,:) until the next sample; FOH interpolates linearly between successive samples. Both use a single augmented exponential and exact propagation up to rounding. Discrete models use direct recursion at Ts; interpolation options have no effect on discrete recursion. SISO transport delays use the selected hold at the shifted input times.
No automatic time vector: t must be uniform, start at zero, and contain 2..10000 samples. Discrete spacing must equal Ts. Work and storage bounds are the same as step.
Example
G=ss(-2,1,1,0); t=(0:0.1:5)'; [y,t,x]=lsim(G,sin(t),t,0,'foh')Differences from MATLAB: Default interpolation is always ZOH. Nonuniform times and automatic interpolation selection are unsupported; inputs must be finite real doubles.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.