This function finds the best segmentation given a Cost Matrix using a dynamic programming algorithm. C++ implementation of DynProg

DynProg_algo_cpp(matD, Kmax)

Arguments

matD

Cost Matrix

Kmax

number of segments