Problem with data type: calculate [HH:mm:ss.FFF]
1 次查看(过去 30 天)
显示 更早的评论
Hey, I need an easy way, to convert this time from [HH:mm:ss.FFF] into seconds. I have tried different ways, but I always have problems with the type of the data.
If I convert the data from str2double, I get "NaN" or can I seperate "HH, mm, ss, FFF" to calculate the seconds?
Thanks and best regards René
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/279394/image.jpeg)
0 个评论
回答(1 个)
Steven Lord
2020-3-25
Convert the text representations of those values into a duration array then call seconds on the duration array.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!