Implemented the CDGPS algorithm using MATLAB.