Change-point analysis functions for use with Matlab