HOW TO CONVERT TIME IN NUMERIC FORMAT?

1 回表示 (過去 30 日間)
Vishnu Dhakad
Vishnu Dhakad 2019 年 6 月 17 日
回答済み: Monika Phadnis 2019 年 6 月 17 日
I have date and time in different 6 column.
1st column: Year, (2019,2019,2019,2019 - - - - - - - 2019)
2nd column: Month, (3,3,3,3, - - - - - - 3)
3rd column: Day, (1,2,3,4,5, - - - - - - -31)
4th column: Hour, (0,1,2,3,4,5, - - - - - - -23)
5th column:Minute (0,1,2,3, - - - - -- - - - -59)
6th column:Seconds with milisecond (0.082, 01.82, 3.082, 4.082, - - - - - )
i want to combine in datetime format.

回答 (1 件)

Monika Phadnis
Monika Phadnis 2019 年 6 月 17 日
You can use the datetime function of Matlab.
Send all the vectors as parameters to the function like this:
datetime(yr_vector,month_vector,day_vector,hour_vector,minutes_vector,seconds_vector);
This returns array of datetime objects.
Check the documentation here.

カテゴリ

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