Unable to comprehend "time" function output

d = caldays(8:10) + hours(1.2345)
d = 1×3 calendarDuration array
8d 1h 14m 4.2s 9d 1h 14m 4.2s 10d 1h 14m 4.2s
t = time(d) % this output
t = 1×3 duration array
01:14:04 01:14:04 01:14:04
Is this output returning the difference between time components of calenderDuration function or only time duration between time values in the array ? can anyone tell more about this output

 採用された回答

Stephen23
Stephen23 2024 年 2 月 9 日
編集済み: Stephen23 2024 年 2 月 9 日

1 投票

"Is this output returning the difference between time components of calenderDuration function or only time duration between time values in the array "
Neither, there are absolutely no differences involved.
Exactly as the TIME documentation states, it returns the time component of calendar duration objects.
In pseudo-nomenclature, if you have this CALENDARDURATION array:
99 days 12h 34m 56s789
then TIME returns the time part only (as a DURATION array):
12h 34m 56s789

2 件のコメント

Stephen23
Stephen23 2024 年 2 月 9 日
If differences were involved this would not work:
d = caldays(8) + hours(1.2345)
d = calendarDuration
8d 1h 14m 4.2s
t = time(d)
t = duration
01:14:04
t.Format = "hh:mm:ss.SSS"
t = duration
01:14:04.200
VBBV
VBBV 2024 年 2 月 9 日
Ok, Thanks for explanation @Stephen23

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDates and Time についてさらに検索

質問済み:

2024 年 2 月 9 日

編集済み:

2024 年 2 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by