My overall goal: I have measurements from different sensors which are performed simoultaneously, but with different timesteps. Now, I want to use both outputs in order to do some calculations.
So, I need to calculate mean values from some measurements (e.g. timesteps of each 10sec) in order to put them into the same format likewise the other measurements (timesteps of each 10min). In the end I want to have the different measurements with equal timesteps.
Hence, one table and its timesteps represent a pattern, and I want to convert the other table into the same pattern with regard to the timesteps.
Therefore, I have started to build up a for loop to write a table with (1) the timesteps and (2) the corresponding calculated mean values. I have started with the timesteps, but I am facing an issue with the duration array within this for loop. It gives me "Error using duration/double".
My short code so far:
in_timesteps = 'C:\Users\Judith\Desktop\phd\Data\Hukseflux\Calculations\26.07.2021_28.07.2021_calc_Enet.csv';
in_measured = 'C:\Users\Judith\Desktop\phd\Data\daten_wetterstation\WL__2021_07_27.csv';
measure_day = '27.07.2021';
output = 'C:\Users\Judith\Desktop\phd\Data\Hukseflux\Calculations\';
data_timesteps = readtable(in_timesteps, 'NumHeaderLines', 0, 'Delimiter', ',' ,'DecimalSeparator', '.', "VariableNamingRule" , "preserve");
data_measured = readtable(in_measured, 'NumHeaderLines', 0, 'Delimiter', ',' ,'DecimalSeparator', '.', "VariableNamingRule" , "preserve");
data_measured.Properties.VariableNames = regexprep(data_measured.Properties.VariableNames, ' ', '_');
ind_dt = find(data_timesteps.Date == measure_day);
H = zeros(sum(data_timesteps.Date == measure_day),2);
for i = 1:(sum(data_timesteps.Date == measure_day))
H(i,1) = data_timesteps.Time(ind_dt(i))
Any help is very much appreciated.