How to show the date and time with retime function?

1 view (last 30 days)
Good morning,
I have a timetable (TT) which contains in the first column the time (TT_time)and in the second column the water height values (TT.value).
I have applied the retime function to calculate the daily maximum with the following line:
Max=retime(TT,'daily','max').
The result shows the daily maximum and its date (e.g. '07-Jan-1994') but does not retain the time at which the maximum was recorded.
So how can I display the date and time when the daily maximum was recorded (e.g. '07-Jan-1994 14:20:00)?
Thank you for your answers!

Answers (1)

Corey Silva
Corey Silva on 18 May 2022
Because you are retiming the Timetable to daily, you are only going to see the max value for that day. If you want to get the timetable's row at the max recorded value, you could do something like this:
>> [~,maxidx] = max(TT.value);
>> TT(maxidx,:)

Categories

Find more on Dates and Time in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!