This paper presents a computationally efficient mode-matching method to predict the relative axial motion of two elastic rods in frictional contact. The motion is of the stick-slip type and is non-uniform along the rods. The proposed method utilizes the piecewise linearity of the problem in time and space. The original set of nonlinear partial differential equations describing the dynamics of the coupled system is first reduced to a system of linear, per time interval, ordinary differential equations by means of modal decomposition. The global modes are used for one of the two rods, while for the other rod, different modes are identified per time interval based on the regions in stick or slip phase. Subsequently, the system response is obtained by combining the piecewise linear solutions. A comparison of the solution method proposed with standard numerical techniques shows its advantage both in terms of computational time and accuracy. Numerical examples demonstrate the capability of the method to analyse cases involving either harmonic- or impact-type forces that drive the relative motion. Although the discussion in this paper is limited to the one-dimensional configuration, the approach is generic and can be extended to problems in more dimensions.