How to show the date and time with retime function?

2 vues (au cours des 30 derniers jours)
Flavio Croce
Flavio Croce le 17 Mai 2022
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!

Réponses (1)

Corey Silva
Corey Silva le 18 Mai 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,:)

Catégories

En savoir plus sur Dates and Time dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by