Code for knn matting. Generic function to make a prediction for a time series if a. Matlab code ready to run.