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

8 Ansichten (letzte 30 Tage)
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 Kommentar
per isakson
per isakson am 13 Dez. 2017
Bearbeitet: per isakson am 14 Dez. 2017
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
>>

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 14 Dez. 2017
datalog.DateAndTime = datalog.DateAndTime + years(2000);

Weitere Antworten (0)

Kategorien

Mehr zu Numeric Types finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by