Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
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 comentario
per isakson
per isakson el 13 de Dic. de 2017
Editada: per isakson el 14 de Dic. de 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
>>

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 14 de Dic. de 2017
datalog.DateAndTime = datalog.DateAndTime + years(2000);

Más respuestas (0)

Categorías

Más información sobre Numeric Types en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by