Create a numeric variable with date+hour
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
David E.S.
am 11 Feb. 2021
Kommentiert: David E.S.
am 11 Feb. 2021
Hi. I have a problem when I want to create a numeric variable which contains date + hour. This is my data:
So... I want to obtain a number with the sumatory by rows (both columns are strings). Can you help me?
Thanks!
MATLAB VERSION: R19b
2 Kommentare
Akzeptierte Antwort
Steven Lord
am 11 Feb. 2021
How are you planning to use this "numeric variable with date+hour"? It's quite likely that you can achieve your goal with a datetime array.
dateAndTime = ["19/11/19", "05:16:41"; "19/11/19", "05:19:03"; "19/11/19", "05:21:26"]
dATWithSpace = join(dateAndTime, " ")
dt = datetime(dATWithSpace, 'InputFormat', 'dd/MM/yy hh:mm:ss')
For example, you can plot with it.
plot(dt, [1 4 9], 'o-')
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!