Assuming you have data stored in times
and values
matrices in Matlab where times
is not unique, but it represents the time and date data, you can interpolate the data to a 5 minute time series instead of 15 minute using the following steps:
Convert the times
matrix to serial date numbers using datenum
function.
Create a new time vector with a 5-minute interval using min
function, floor
function, and datenum
function. This new time vector will be used as the basis for the 5-minute time series.
main.m240 chars4 lines
values
matrix to the new time vector using interp1
function.main.m48 chars2 lines
datestr
function.main.m52 chars2 lines
Now new_dates
will be a column vector of dates corresponding to interpolated data in new_values
.
gistlibby LogSnag