I do not believe that the k-NN regression algorithm is directly implemented in Matlab, but if you do some kind of search on Google, you may find some correct implementations. However, the algorithm is quite simple.
- Find k-Nearest items using any distance metric.
- Converting the weight of the reciprocal distance of each of k elements
- Calculate a weighted average of k elements using the reciprocal distance weight.