function X = sign_mnare(A,B,C,D) % X=SIGN_MNARE(A,B,C,D) solves the M-NARE C + XA + DX - XBX = 0 % by means of the matrix sign function % A, B, C, D: matrix coefficients % X : solution of the M-NARE [n,m] = size(B); H = [A,-B;-C,-D]; W = matrix_sign(H) - eye(m+n); X = -W(1:m+n,n+1:n+m)\W(1:m+n,1:n);