MATLAB has a dynamic plotting library called comet which is used to trace trajectories using an animated graph in which a circle (the comet head) traces the data points on the screen. The comet body is a trailing segment that follows the head. The tail is a solid line that traces the entire function.
The default function gives the entire history of trajectories where as the user defined function traces only the current trajectory at any time instant.
DEFAULT FUNCTION
USER DEFINED FUNCTION