Path: news.mathworks.com!not-for-mail
From: "Michael Zhang" <cy_xiaoxiao@126.com>
Newsgroups: comp.soft-sys.matlab
Subject: LMI term dimensions incompatible
Date: Thu, 8 May 2008 04:19:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 128
Message-ID: <fvtuvp$aiv$1@fred.mathworks.com>
Reply-To: "Michael Zhang" <cy_xiaoxiao@126.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210220345 10847 172.30.248.38 (8 May 2008 04:19:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 8 May 2008 04:19:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1379620
Xref: news.mathworks.com comp.soft-sys.matlab:467291



Is anyone can help me? I can figure out what happened to my 
programm.

I need to solve a inequality:

| -Q+Bd*S2*Bd'+Ad*S1*Ad' A*Q+B2*M   B1
|      Q*A'+M'*B2'         -Q       0
|          B1'              0       -gammar^2*I
|   Dd*S2*Bd'+Cd*S1*Ad'  C*Q+D12*M  D11
|          0                M       0
|          0                Q       0

    Bd*S2*Dd'+Ad*S1*Cd'     0       0  |
         Q*C'+M'*D12'       M'      Q  |
             D11'           0       0  |  <0
  -I+Cd*S1*Cd'+Dd*S2*Dd'    0       0  |
             0             -S2      0  |
             0              0      -S1 | 
  
Matrices:Q, S1, S2 are positive-define.

Below is programm:
===================================================
A = [2 1; 0 1];
Ad = [0.2 0.1; 0 0.1];
B1 = [0.1 0.1]';
B2 = [1 1]';
Bd = [0.1 0.1]';

C = [1, 1];
Cd = [0.1, 0.1];

D11 = 0.1;
D12 = 1;
Dd = 0.1;

gammar = 1;

% Initial a LMI system
setlmis([]);

% Define Variables

% Q is a symmetric matrix, has a block size of 2 and this 
block is symmetric 
Q = lmivar(1, [2 1]);

% S1 a symmeric matrix, size 2 by 2
S1 = lmivar(1, [2 1]);


% S2 is 1 by 1 matrix
S2 = lmivar(1, [1 0]);


% Type of 2, size 1 by 2 
M = lmivar(2, [1 2]);


%I use upper triangular to represent the LMI

% pos in (1, 1)
lmiterm([1 1 1 Q], -1, 1);
lmiterm([1 1 1 S2], Bd, Bd');
lmiterm([1 1 1 S1], Ad, Ad');

% pos (1, 2)
lmiterm([1 1 2 Q], A, 1);
lmiterm([1 1 2 M], B2, 1);

% pos(1, 3)
lmiterm([1 1 3 0], B1);

% pos(1, 4)
lmiterm([1 1 4 S2], Bd, Bd');
lmiterm([1 1 4 S1], Ad, Cd');


% pos(2, 2)
lmiterm([1 2 2 Q], -1, 1);

% pos(2, 4)
lmiterm([1 2 4 Q], 1, C');

lmiterm([1 2 4 -M], 1, D12');

% pos(2, 5)
lmiterm([1 2 5 -M], 1, 1);

% pos(2, 6)
lmiterm([1 2 6 Q], 1, 1);

% pos(3, 3)
lmiterm([1 3 3 0], -(gammar^2));

% pos(3, 4)
lmiterm([1 3 4 0], D11');

% pos(4, 4)
lmiterm([1 4 4 0], -1);
lmiterm([1 4 4 S1], Cd, Cd');
lmiterm([1 4 4 S2], Dd, Dd');

% pos(5, 5)
lmiterm([1 5 5 S2], -1, 1);


% pos(6, 6)
lmiterm([1 6 6 S1], -1, 1);

lmis = getlmis;

[tmin, feas] = feasp(lmis)

--------------------------------
When I run it, I get error message:

??? Error using ==> lmiterm at 296
lhs of LMI #1, block (4,1): term dimensions incompatible 
with
other terms in same row

Error in ==> paperor at 56
lmiterm([1 1 4 S1], Ad, Cd');

I have checked many times and can't figure out why it is 
wrong, can anybody point it to me?