Add time to a datetime array
11 ビュー (過去 30 日間)
古いコメントを表示
I have to select the hourly value of relative air saturation and temperature at 14:05 a clock.
From an datetime array containing the 10 minutes values of all dates i created an daily datetime array using:
dt = table2array(T(:,3 ));
dt = datetime(dt, 'InputFormat', 'dd-mmm-yyyy HH-MM-SS');
dt_daily = dt(1:144:end);
how can i add to each dt_daily 14 hours so that i have an index to extract the respective values from the table?
Thanks a lot for your help!
Best regards,
Arthur
0 件のコメント
採用された回答
Cris LaPierre
2021 年 3 月 9 日
I would use the datetime values you already have in your table T.
load T_matlab.mat
ind = timeofday(T.DateTime) == duration(14,05,0);
dayT = T(ind,["DateTime","H_air___","T_air_C_"])
0 件のコメント
その他の回答 (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!