Robots have long been part of production lines and, since they are widely used in a variety of applications, they have become a mass product. Yet, their integration into production is costly due to the necessity of skilled engineers programming them. The goal of this article is to reduce these costs via a programming by demonstration approach, allowing unskilled workers to complete the task of said engineers. Rather than just working next to a robot, this enables a collaborative work environment where humans use manipulators as tools for various tasks. This work aims at automatically generating a trajectory by a single kinesthetic demonstration, which is performed by a non-expert user. The proposed approach adapts and extends the trajectory generator of a previous work and develops a method that gives guarantees on the deviation between the demonstrated path and the generated path. In contrast to the previous work, an expert user is not required. Furthermore, instead of teaching a series of points the whole trajectory is recorded in a single demonstration. To ensure real-time compatibility on the target hardware, one focus of this paper is on the complexity of the algorithm. The method is validated using a soft quasi continuum manipulator as an example for a collaborative robot.