How to convert a vector of durations to just floats
29 次查看(过去 30 天)
显示 更早的评论
I have a vector of duration types that are all seconds and I want to convert that vector to just a vector of floating point numbers. How can I do this?
0 个评论
回答(1 个)
Geoff Hayes
2019-3-6
Seth - could you try using the Convert Durations to Numeric Array of Seconds example and just convert as
X = ...; % your duration in seconds array
S = seconds(X); % S is the floating point equivalent
I haven't tried the above...but it might work.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!