I have a matrix "V" with N = 100 rows and T = 30 columns which describes the value of a fund for 30 years. The expenditure that the fund have to do for the next year should be the arithmetic mean of the last three years fund's value. This is inside a for loop, so i have to do this for 30 years (T), N times.
I tried the code below, but it does'nt work:
for t = 1: T E (1: N, t +1) = (mean (V (1: N, t: t-2), 2)));