How to show the date and time with retime function?

조회 수: 1 (최근 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 CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by