Cody

Problem 1116. Calculate the height of an object dropped from the sky

Solution 3703763

Submitted on 17 Nov 2020
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
t = -1; h_correct = 1000; assert(abs(height_of_object_at_time(t)-h_correct)<0.1)

Undefined function 'height_of_object_at_time' for input arguments of type 'double'. Error in Test1 (line 3) assert(abs(height_of_object_at_time(t)-h_correct)<0.1)

2   Fail
t = 0; h_correct = 1000; assert(abs(height_of_object_at_time(t)-h_correct)<0.1)

Undefined function 'height_of_object_at_time' for input arguments of type 'double'. Error in Test2 (line 3) assert(abs(height_of_object_at_time(t)-h_correct)<0.1)

3   Fail
t = 1; h_correct = 995.1; assert(abs(height_of_object_at_time(t)-h_correct)<0.1)

Undefined function 'height_of_object_at_time' for input arguments of type 'double'. Error in Test3 (line 3) assert(abs(height_of_object_at_time(t)-h_correct)<0.1)

4   Fail
t = 10; h_correct = 510; assert(abs(height_of_object_at_time(t)-h_correct)<0.1)

Undefined function 'height_of_object_at_time' for input arguments of type 'double'. Error in Test4 (line 3) assert(abs(height_of_object_at_time(t)-h_correct)<0.1)

5   Fail
t = 15; h_correct = 0; assert(abs(height_of_object_at_time(t)-h_correct)<0.1)

Undefined function 'height_of_object_at_time' for input arguments of type 'double'. Error in Test5 (line 3) assert(abs(height_of_object_at_time(t)-h_correct)<0.1)

Suggested Problems

More from this Author1

Community Treasure Hunt

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

Start Hunting!