How to convert a vector of durations to just floats

27 vues (au cours des 30 derniers jours)
Seth Charles
Seth Charles le 6 Mar 2019
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?

Réponses (1)

Geoff Hayes
Geoff Hayes le 6 Mar 2019
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.

Catégories

En savoir plus sur Dates and Time dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by