First, you can reshape your matrix X (which is 708*1)
Find sum of all the 59 columns which will give you Sum of all 12 months rainfall for every 59 year
Now initialize a matrix with Zeros of size 1*59 and compute sum of (July, August, September) rainfall for every 59 year.
A(i)= sum(Y(7:9, i));
Now calculate Percentage of (July, August, September) rainfall over year for all 59 year.
Calculate average of percentage
I hope, it helps you to solve your problem.