dlqr [control]
— Function File: [k, p, e] = dlqr (a, b, q, r, z)

Construct the linear quadratic regulator for the discrete time system

          x[k+1] = A x[k] + B u[k]

to minimize the cost functional

          J = Sum (x' Q x + u' R u)

z omitted or

          J = Sum (x' Q x + u' R u + 2 x' Z u)

z included.

The following values are returned:

k
The state feedback gain, (a - bk) is stable.
p
The solution of algebraic Riccati equation.
e
The closed loop poles of (a - bk).