T1 = datetime('2018-03-14 16:30:54'); T2 = datetime('2018-03-14 16:40:54');
dT = T2 - T1;
T_mid = T1 + dT/2;
T1 = datetime('2018-03-14 16:30:54'); T2 = datetime('2018-03-14 16:40:54');
dT = T2 - T1;
T_mid = T1 + dT/2;
>> d = datetime(2018,3,14,16,[30 40],54) d = 1×2 datetime array 14-Mar-2018 16:30:54 14-Mar-2018 16:40:54 >> mean(d) ans = datetime 14-Mar-2018 16:35:54 >> diff(d) ans = duration 00:10:00
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!