In the process of dynamic movement primitives (DMPs) based trajectory learning, the position error between the end point of the learned trajectory and that of the real trajectory is always large. For this problem, a new method is developed to reduce the position error by increasing the number of integral steps in DMPs. In simulation, both sine function and ramp function are used to construct teaching trajectories, respectively, to verify the effectiveness of the new method. When the start point of the learned trajectory is same as the target point, the learned trajectory is always a line trajectory based on DMP. In order to solve the problem, a segmented trajectory learning method is proposed. Specifically, the proposed method treats the extreme points of the trajectory as cut-off points, and then segments the learned trajectory into several new trajectories whose start points depart from the target points. Simulation results also verify the effectiveness of the proposed method.