フィルターのクリア

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

2 ビュー (過去 30 日間)
Kasih Ditaningtyas Sari Pratiwi
Kasih Ditaningtyas Sari Pratiwi 2017 年 12 月 13 日
回答済み: Walter Roberson 2017 年 12 月 14 日
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 Center および File ExchangeNumeric Types についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by