How could i convert timestamp to nanosecond and what would be the way to get data in nanoseconds for given period?
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mantas Vaitonis
el 8 de Nov. de 2018
Respondida: Steven Lord
el 8 de Nov. de 2018
Hello, Maybe someone could bring me on the right track. How could I convert the given time stamp to nanoseconds?
20180429,14:00:26.525162436,898,23252,ESM8,ES,ES,A
20180429,14:00:26.527757600,2899,7594,ESM8-ESH9,ES,ES,A
20180429,14:00:26.530015551,908,36759,ESM8-ESU8,ES,ES,A
20180429,14:00:26.530772312,910,1691,ESM8-ESZ8,ES,ES,A
20180429,14:00:26.531110319,911,736,ESM9,ES,ES,A
And what would be the way to get timestamps in nanosecond between period from 20180429 14:00:00.000000000 till 2018042914:00:00.000000000. It is needed that I could make comparisons between time and the given data like in example.
0 comentarios
Respuesta aceptada
Steven Lord
el 8 de Nov. de 2018
Call readtable. Reassemble the date and time string into one block of text then call datetime to convert that text representation into a datetime array.
t = readtable('answer428720.csv')
t.str = t.Var1 + " " + string(t.Var2)
fmt = 'yyyyMMdd HH:mm:ss.SSSSSSSSS';
t.timestamp = datetime(t.str, 'InputFormat', fmt, 'Format', fmt)
You could modify the readtable call or the import options to do this in fewer lines of code, but this is fairly readable IMO.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Dates and Time en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!