1function X=QBD_NI_Sylvest(A,B,C,D)
2%
this function solves the equation AXB+CX=D
3%
using a complex schur and a hessenberg-triangular decomposition
5 [LBAR,NBAR,W,V]=hess(A,C);
6 %W*A*V = LBAR, W*C*V = NBAR
7 [U,T]=schur(B,
'complex');
19 tempmat(:,k-1)=-LBAR*Y(:,k-1);
20 temp=F(:,k)+sum(tempmat(:,1:k-1).*kron(ones(n,1),T(1:k-1,k).'),2);
22 Y(:,k)=(NBAR+T(k,k)*LBAR)\temp;
23 % MATLAB checks that NBAR+T(k,k)*LBAR
is an hessenberg
24 % matrix and quickly reduces it to a triangular one which
is
25 % solved by backward substitution (TEST 6)