Date and number (hour) to times

조회 수: 2 (최근 30일)
Alex
Alex 2019년 10월 21일
답변: Ted Shultz 2019년 10월 21일
I have two columns: First - Date (for example, 24-Jun-2015); Second - Hour for that Date (for example, 9, i.e., just a number of the hour). Can somebody tell me how I can convert these two pieces of information into ONE date?
  댓글 수: 4
Stephan
Stephan 2019년 10월 21일
편집: Stephan 2019년 10월 21일
please give us data that we can work with instead of screenshots - a .mat-file attached to a comment or your question, will help us to help you...
Alex
Alex 2019년 10월 21일
Of course! Here is the file.

댓글을 달려면 로그인하십시오.

답변 (1개)

Ted Shultz
Ted Shultz 2019년 10월 21일
If you convert the date column to datetime, and the hour column to a duration of hours, then you simply add them together to get a new datetime. This datetime can be converted to anything you like.

카테고리

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