getdlq.m 392 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
function [SysD,Q,R,N,K,S] = getdlq(SysC, Qc, Rc, h)
% Get a discrete time LQ, sampled system and cost matrices, from a continous definition
  [SysD,Q,R,N,R1,Qconst] = lqgsamp(SysC,h,Qc,Rc,zeros(size(SysC.B)),zeros(size(SysC.A))); 
  SysD = modred(SysD, 4);
  Q = Q(1:size(SysD.A,1),1:size(SysD.A,1));
  N = N(1:size(SysD.A,1), 1:size(SysD.B,2));
  [K,S] = dlqr(SysD.A, SysD.B, Q, R, N);
end