computing number of days between a matrix of dates

1 回表示 (過去 30 日間)
Rosanna
Rosanna 2018 年 10 月 11 日
編集済み: jonas 2018 年 10 月 11 日
Dear All, I have a long file of "dates of occurrences" of events, which are expressed in numbers as Year, Month, Day, Hour, Minutes (e.g. May 23, 2015 at 09:15 is the vector [2015 05 23 09 15]). I want to compute for each event, the distance in days from the starting date (e.g. [2000 01 01 00 00]). Could anyone provide some advice, as to loop the computation? Best regards, Rosanna

回答 (1 件)

jonas
jonas 2018 年 10 月 11 日
編集済み: jonas 2018 年 10 月 11 日
Put all dates in datetime format
T = datetime(Tvec)
then
Tdiff = T - T(1)
will output a duration vector

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by