필터 지우기
필터 지우기

How to change the year format in time series data? ("0017" to "2017")

조회 수: 2 (최근 30일)
Hi. I need help. I want to ask about how to change the format of year in Matlab. I intend to concatenate horizontally two data based on the datetime data. Both data has the same range of datetime. However, turns out one data has this format for the year "0017' and the other is "2017", so that they can not concatenate. I want to ask about how to change 0017 to 2017, but not limited to 2017. For example if the data is based on 2018 time series data. One data would be 0018 and the other is 2018. I attach the two tables here. One with 0017 and the other with 2017. Once I change 0017 to 2017, they both can concatenate horizontally.
20.Nov.0017 00:00:00
20.Nov.0017 00:05:00
20.Nov.0017 00:10:00
20.Nov.0017 00:15:00
20.Nov.0017 00:20:00
20.Nov.0017 00:25:00
and the other data :
20.11.2017 00:00:00
20.11.2017 00:05:00
20.11.2017 00:10:00
20.11.2017 00:15:00
20.11.2017 00:20:00
20.11.2017 00:25:00
20.11.2017 00:30:00
Could you please help me? I am really stuck in this thing. Thank you very much for your help.
  댓글 수: 1
per isakson
per isakson 2017년 12월 13일
편집: per isakson 2017년 12월 14일
I fail to produce the output that you show from the contents of the mat-files, i.e from datalog and datasampling. Is that because I use 2016a?
>> whos data*
Name Size Bytes Class Attributes
datalog 6x1 24 uint32
datasampling 6x1 24 uint32
>> datalog'
ans =
3707764736 2 1 1 1 2
>> datasampling'
ans =
3707764736 2 1 1 1 2
>>

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

채택된 답변

Walter Roberson
Walter Roberson 2017년 12월 14일
datalog.DateAndTime = datalog.DateAndTime + years(2000);

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by