I'm using the 'retime' command to return the daily minimum for a series of daily readings. Each reading of the multiple daily readings has t[w]o variables which relate to them, Height and Tide. I am trying to find the daily minimum height for each day and its corresponding tide value. So far my code returns the min Height and Tide for each day, has anyone encountered this problem before and have a solution?
filename_LT = 'tidal_data_jtide.txt';TD = readtable(filename_LT); DT1 = datetime([TD.Var1]);DT2 = cell2mat(TD.Var2);DT2_1 = DT2(:,1);DT2_2 = DT2(:,2);DT2_3 = DT2(:,4);DT2_4 = DT2(:,5);DT2_5 = DT2(:,7);DT2_6 = DT2(:,8);DT3 = strcat(DT2_1,DT2_2,DT2_3,DT2_4,DT2_5,DT2_6);DT4 = str2num(DT3);TD=table(DT1,TD.Var5,Tide_date_time, ... 'VariableNames',{'Time','Height','Tide'});TD_timetable = table2timetable(TD);LT_data = retime(TD_timetable,'daily','min');
Best Answer