MATLAB: Interpolation of hourly data into minutes

interpolationMATLABtime series

Hello I am in need to convert few days hourly data to minutes.However I need the minute datas between two hours to be within the range of the value of the hour.Say i have hourly data for one day [1*24] A = 240 220 210 200 240 280 340 360 380 400 440 460 420 440 460 480 500 540 650 620 580 540 420 350. I need to convert this to minute data for one day [1*1440] matrix. The value of the 59 interpolation datas between the first two hour should be between 240 and 220 similarly for the second and third hour the 59 values are to be between 220 and 210 and so on. Any help would be much appreciated.

Best Answer

A = [240 220 210 200 240 280 340 360 380 400 440 460 420 440 460 480 500 540 650 620 580 540 420 350] ;
t = 1:60:24*60 ;
% interpolation
ti = 1:1:24*60 ;
Ai = interp1(t,A,ti) ;
plot(t,A,'.-r')
hold on
plot(ti,Ai,'b')
legend('Original', 'interpolated')