MATLAB: Pseudo-color a moving object track based on its length from origin.

colorcolormapImage Processing Toolboxlineplottrack;

If I have the xy positions of a tracked object's track, how can I pseudo-color the track with a map like jet, based on its length from origin?
Related Question