Cody

# Problem 62. Elapsed Time

Solution 1936009

Submitted on 14 Sep 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
d1 = '2010/12/14 12:00:00'; d2 = '2010/12/17 17:06:00'; elapsed = 77.1; assert(abs(elapsed_time(d1,d2) - elapsed) < 1e-6)

y = 0 m = 0 d = 0 h = 3 p = 0 s = 0.0014 elapsed = 3.0014

Assertion failed.

2   Fail
d1 = '2010/12/14 12:00:00'; d2 = '2010/12/14 12:00:01'; elapsed = 1/3600; assert(abs(elapsed_time(d1,d2) - elapsed) < 1e-6)

y = 0 m = 0 d = 0 h = 0 p = 0 s = 0 elapsed = 0

Assertion failed.

3   Fail
d1 = '1924/1/7 12:45:00'; d2 = '2010/12/14 17:06:00'; elapsed = 762076.35; assert(abs(elapsed_time(d1,d2) - elapsed) < 1e-6)

Matrix dimensions must agree. Error in elapsed_time (line 2) a=d2-d1; Error in Test3 (line 4) assert(abs(elapsed_time(d1,d2) - elapsed) < 1e-6)

4   Fail
d1 = '2010/12/14 12:00:00' d2 = '2010/12/14 13:06:36' elapsed = 1.11; assert(abs(elapsed_time(d1,d2) - elapsed) < 1e-6)

d1 = '2010/12/14 12:00:00' d2 = '2010/12/14 13:06:36' y = 0 m = 0 d = 0 h = 0 p = 0 s = 2.7778e-04 elapsed = 2.7778e-04

Assertion failed.