Converting a timestamp into a value that can be plotted
4 views (last 30 days)
Show older comments
Hi,
I have a timestamp data in the format of '11/04/2022 12:23:58 PM' '11/04/2022 12:24:04 PM' ... etc.
For me to able to convert this in a format where it can be used to plot a voltage as a function of time, it seems like I have to make some changes. I tried some of the methods that can be found online, but they did not seem to apply for the format I have for timestamp.
Any help would be appreiciated!
0 Comments
Answers (1)
Star Strider
on 18 Apr 2023
Perhaps something like one of these —
ts = ['11/04/2022 12:23:58 PM';'11/04/2022 12:24:04 PM'] % Text Time Stamps
dt = datetime(ts, 'InputFormat','dd/MM/yyyy hh:mm:ss a', 'Format','yyyy/MM/dd HH:mm:ss') % 'datetime' Array
du = diff([dt(1); dt]) % 'duration' Array
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!