Mercurial > matrix-functions
view funm_files/sylv_tri.m @ 0:8f23314345f4 draft
Create local repository for matrix toolboxes. Step #0 done.
author | Antonio Pino Robles <data.script93@gmail.com> |
---|---|
date | Wed, 06 May 2015 14:56:53 +0200 |
parents | |
children |
line wrap: on
line source
function X = sylv_tri(T,U,B) %SYLV_TRI Solves triangular Sylvester equation. % x = SYLV_TRI(T,U,B) solves the Sylvester equation % T*X + X*U = B, where T and U are square upper triangular matrices. m = length(T); n = length(U); X = zeros(m,n); % Forward substitution. for i = 1:n X(:,i) = (T + U(i,i)*eye(m)) \ (B(:,i) - X(:,1:i-1)*U(1:i-1,i)); end