%%**************************************************************** %% lmifun: generate SDP data for the LMI constraint %% of the form: %% %% A*P*B' + B*P*A' + H*diag(d)*H' %% P and d are variables, P is symmetric. %% %% H is optional. %%***************************************************************** %% SDPT3: version 4.0 %% Copyright (c) 1997 by %% Kim-Chuan Toh, Michael J. Todd, Reha H. Tutuncu %% Last Modified: 16 Sep 2004 %%***************************************************************** function Avec = lmifun(A,B,H) n = size(A,2); n2 = n*(n+1)/2; r2 = sqrt(2); Acell = cell(1,n2); cnt = 1; %% for j = 1:n Bj = B(:,j); Aj = A(:,j); for i = 1:j Ai = A(:,i); Bi = B(:,i); if (i