  We define the set of almost-intertwining matrices to be all triples(X,Y,Z) of
n x n matrices for which XZ=YX+T for some rank one matrix T. A surprisingly
simple formula is given for tau-functions of the KP hierarchy in terms of such
triples. The tau-functions produced in this way include the soliton and
vanishing rational solutions. The induced dynamics of the eigenvalues of the
matrix X are considered, leading in special cases to the Ruijsenaars-Schneider
particle system.
