How to to create timestamp from imported data when time data is sperated in three different columns (Month ,Day, Hour)

조회 수: 1 (최근 30일)
I am importing wave height data into Matlab to do some análisis. I would like to do a timestamp or represent the time value for each wave height value in some way. However the time data is separated into different columns (Months, Day, Hour). It is not of the format 01-07-2018 9:00. Any ideas? Thank you.

답변 (2개)

KSSV
KSSV 2018년 3월 14일
Read about datestr
d = [2018 03 14 12 0 0] ;
datestr(d)

Akira Agata
Akira Agata 2018년 3월 14일
If Months, Day and Hour are vector with the same length, and assuming Year = 2018, the following can generate datetime vector which is corresponds to the timestamp.
timeStamp = datetime(2018,Month,Day,Hour,0,0);

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by