Please advise how to solve the following problem - I need to calculate correlation for two arrays. The problem is that each following correlation coefficient is calculated for different intervals i.e. first coefficient is calculated for previous 20 values, next - for 21 values and so on. I need to calculate correlation for past 20 cells.

I apologize for my English.