Create elapsed time vector for loop
Show older comments
Hi everyone!
I'm new to this so any help would be greatly appreciated!
I would like to analyse some accelerometer data and I'd like to convert the timestamp to elapsed time, with the start of recording being 0. Then, I'd like to create a for loop to do this for the entire column (a few thousand rows), and write the result in a new column.
(Some additional context, if helpful: I have already converted the datetime from 'yyyy-MM-dd HH:mm:ss.SSS' to 'HH:mm:ss.SSS' since the experiments are short and don't take more than a few minutes each. The sampling frequency is 100Hz and so I have samples every 0.001-0.002 seconds. I will then need to find peaks within different elapsed periods).
Could you please help me with the conversion and for loop creation? I have foundhttps://uk.mathworks.com/matlabcentral/answers/386394-plot-datetime-vector-as-elapsed-time-in-seconds-from-start-of-meaurement, https://uk.mathworks.com/matlabcentral/answers/373223-how-to-calculate-time-elapsed-time-in-gmt-format and https://uk.mathworks.com/matlabcentral/answers/410089-create-a-function-to-find-elapsed-time-with-string-of-date-and-times-through-samples but I am not sure how to repurpose them.
Thank you in advance!
Evelyn
Accepted Answer
More Answers (0)
Categories
Find more on Dates and Time in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!