| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Control System Toolbox |
| Contents | Index |
| Learn more about Control System Toolbox |
rsys = reg(sys,K,L)
rsys = reg(sys,K,L,sensors,known,controls)
rsys = reg(sys,K,L) forms a dynamic regulator or compensator rsys given a state-space model sys of the plant, a state-feedback gain matrix K, and an estimator gain matrix L. The gains K and L are typically designed using pole placement or LQG techniques. The function reg handles both continuous- and discrete-time cases.
This syntax assumes that all inputs of sys are
controls, and all outputs are measured. The regulator rsys is
obtained by connecting the state-feedback law
and the state estimator with gain
matrix L (see estim). For a
plant with equations
![]()
this yields the regulator
![]()
This regulator should be connected to the plant using positive feedback.

rsys = reg(sys,K,L,sensors,known,controls) handles more general regulation problems where:
The plant inputs consist of controls
, known inputs
, and stochastic inputs
.
Only a subset
of the plant outputs is measured.
The index vectors sensors, known,
and controls specify
,
, and
as subsets of the outputs and inputs
of sys. The resulting regulator uses
as inputs to generate
the commands
(see figure below).

Given a continuous-time state-space model
sys = ss(A,B,C,D)
with seven outputs and four inputs, suppose you have designed:
A state-feedback controller gain K using inputs 1, 2, and 4 of the plant as control inputs
A state estimator with gain L using outputs 4, 7, and 1 of the plant as sensors, and input 3 of the plant as an additional known input
You can then connect the controller and estimator and form the complete regulation system by
controls = [1,2,4]; sensors = [4,7,1]; known = [3]; regulator = reg(sys,K,L,sensors,known,controls)
estim, kalman, lqgreg, lqr, dlqr, place
![]() | real | reshape | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |