% Function to decompose A into U (survival) and F (fertility) matrices.
%
% Input:
%    A = the projection matrix (n by n matrix)
%
% Output:
%    U = the survival matrix (n by n matrix)
%    F = the fertility matrix (n by n matrix)
%

function [U, F] = UFdecomp(A)

[n, n] = size(A);

U = A;
U(1, 2:n) = zeros(1, n-1);
F = A-U;

end