Let $A$ be an $n\times n$ diagonalizable matrix, and given a $n \times n$
perturbation matrix $P$. The perturbed matrix
$$ B(t) = A + tP, $$ where $t$ evolves in small steps from 0 to 1. I would like to find the trajectories of the eigenvalues $\lambda_i(t)$ of $B(t)$ for $1 \leq i \leq n$. It is well known that the eigenvalues are a continuous function of the matrix eigenvalues. However, the typical eigenvalue decomposition does not 'preserve' such an order, e.g., MATLAB's eig function returns the eigenvalues in some unsorted way.
What is a practical and robust way to collect the eigenvalues of $B(t)$ into continuous functions $\lambda_i(t)$? A MATLAB specific answer is welcome but not necessary.