Is it possible to convert a duration array to something else like a number or string?
Show older comments
When finding the difference between two datetime scalars the result is a duration array. And i need it to be a double or a string.
Accepted Answer
More Answers (2)
Walter Roberson
on 19 Dec 2016
4 votes
You can apply char() to a duration object. You can set the Format property of the duration object before using char()
Mohammad Kifayath Chowdhury
on 16 Apr 2021
3 votes
This could be useful,
Tx=datetime(T1)-datetime(T2);
Tx=hours(Tx); This will give the hours value as double.
Categories
Find more on Time Series Objects 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!