FUNCTION REFERENCE
lqr
Design optimal quadratic state feedback.
Design optimal quadratic state feedback.
Syntax
[K,S,P] = lqr(A,B,Q,R,N)Syntax
[K,S,P] = lqr(sys,Q,R,N)N is optional and defaults to zero. Minimizes the infinite-horizon quadratic cost with state weight Q, input weight R and cross term 2*x'*N*u. Feedback is u=-K*x; S is the Riccati solution and P the closed-loop poles. Matrix inputs use continuous time; an LTI model uses its sampling time to select CARE or DARE. R must be positive definite; the Riccati residual must pass 1e-10 relative tolerance.
Example
[K,S,P]=lqr([0 1;0 0],[0;1],eye(2),1);Example
[K,S,P]=lqr(ss(0.8,1,1,0,0.1),1,1);Differences from MATLAB: only finite real double data, identity descriptor and positive definite R, with at most 128 states and inputs; no output-weighted lqry form.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.