"resample applies an antialiasing FIR lowpass filter to x and compensates for the delay introduced by the filter."
So you are getting overshoot on the filtering.
newx = linspace(1, length(rain), 12*length(rain));
mins = interp1(1:length(rain), rain, newx, 'linear');
When people think about resampling something N times, they often think of it as something similar to taking N copies of each entry, except interpolating instead of straight copies. However, this mental model implies taking N copies of the final value, and then having nothing to interpolate it against.
The code I use above says "Okay, there has to be 105120 points including the first and the last, so we need to interpolate at 105118 interior points spaced 8759/105119 apart . This works out just fine mathematically, but it isn't what people would tend to expect.
Best Answer