Given a list of path coordinates, create matrix containing only the first and last point of each path.
Useful links