MATLAB: Using retime command for daily minimum when there are two variables

dailyMATLABmin

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

filename_LT = 'tidal_data_jtide.txt';
TD = readtable(filename_LT);
DT1=datetime(join([string(TD.Var1) string(TD.Var2)]));
Tide_date_time = datenum(DT1);
TD=table(DT1,TD.Var5,Tide_date_time, ... % and then make the final
table
'VariableNames',{'Time','Height','Tide'});
TD_timetable = table2timetable(TD);
%Groups the days in the timetable - Noting there are an inconsitent number
%of samples per day
[group_days, days] = discretize(TD_timetable.Time, 'day');
%Finds the minimum low tide height for each day, and the index within the
day group
[Daily_LT_Height, groupRow] = splitapply(@min, TD_timetable.Height,
group_days);
%Find the offset to get the correct index within the full timetable
DaysPerGroup = hist(group_days, max(group_days));
IdxOffset = cumsum([0,DaysPerGroup]);
%Find the index with respect to minimum tide heights for the full time table
Daily_LT_Idx = groupRow + IdxOffset(1:end-1)';
%Find the corresponding times to minimum tide heights
LT_times = TD_timetable.Time(Daily_LT_Idx);
%Find the corresponding tide values to the minimum tide heights
LT_tides = TD_timetable.Tide(Daily_LT_Idx);