I have a dataset of annual temperature measurements recorded every two weeks. The data looks something like this:
t = 1:14:365; % GENERATE DATA y = 1 + (30-1).*rand(1,length(t)); y1 = 20*sin(2*pi*t/max(t)); % Annual variation °C y1(y1<0) = []; tt = 365/14; time = 1:tt:365; plot(time,y1,'-o');
where it clearly follows the annual temperature cycle.
From this, I wonder if it is possible to add a sine function (which will represent the daily temperature range) to the data? For example, from two-week data, if we interpolated the series to have 8760 measurements, i.e. hourly measurements, so that the series was believable, it would have to be characterized by a daily temperature cycle in addition to the annual temperature cycle. In addition, the daily temperature cycle would have to be a function of temperature measurements at that time, that is, it would have been more summer than winter. Therefore, it might be better to use linear interpolation first to get the data in the form of hourly intervals, and then add a sinusoidal function. Is there any way to write this in a script? or does anyone have an opinion on how to achieve this exactly?
source share