i have a data set (x,y) that i have to approximate with a piecewise linear function, such that lower and upper bounds are satisfied. the image show what's the result I would like to achieve (in red the data set's points; in grey, the linear continuous approximation i would like to describe)image of result to achieve.
Using Matlab, i've divided all points in groups (one for every linear segment) and approximated every linear segment, with needed constraints, in the sense of least squares. But i need to have a continuous function and I am stuck in solving the problem. There's someone that have an idea of what i can do to solve the problem?
thanks in advance to everyone