How to show the date and time with retime function?

2 ビュー (過去 30 日間)
Flavio Croce
Flavio Croce 2022 年 5 月 17 日
回答済み: Corey Silva 2022 年 5 月 18 日
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!

回答 (1 件)

Corey Silva
Corey Silva 2022 年 5 月 18 日
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,:)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by