Cody

Solution 2131700

Submitted on 17 Feb 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
r = 3; h = 2; y_correct = 65.9734; assert(abs(func_frosting(r,h) - y_correct) < 1e-4)

Index exceeds the number of array elements (1). Error in func_frosting (line 2) SA = 2*pi*r(r + h); Error in Test1 (line 4) assert(abs(func_frosting(r,h) - y_correct) < 1e-4)

2   Fail
r = 0.5; h = 0.25; y_correct = 1.5708; assert(abs(func_frosting(r,h) - y_correct) < 1e-4)

Array indices must be positive integers or logical values. Error in func_frosting (line 2) SA = 2*pi*r(r + h); Error in Test2 (line 4) assert(abs(func_frosting(r,h) - y_correct) < 1e-4)