source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/extras/create_HS.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 486 bytes
Line 
1function [H,S]=create_HS(A,B,N,M);
2% CREATE_HS Internal function to define matrices for MPC problem
3
4% Author Johan Löfberg
5% $Id: create_HS.m,v 1.2 2004/07/02 08:17:29 johanl Exp $
6
7
8% How many states
9n=length(A);C = eye(n);p=size(C,1);
10[dummy,m]=size(B);
11
12H=zeros(N*p,length(A));
13S=zeros(N*p,N*m);
14
15Acum=A;
16for j=1:N,
17  H(1+p*(j-1):p*j,:)=C*Acum;
18  Acum=Acum*A;
19end;
20
21for j=1:N,
22  Acum=eye(n);
23  for k=j:-1:1,
24    S(1+p*(j-1):p*j,1+m*(k-1):k*m)=C*Acum*B;
25    Acum=Acum*A;
26  end;
27end;
Note: See TracBrowser for help on using the repository browser.