Cody

# Problem 42808. Sum of logarithms

Solution 1905051

Submitted on 19 Aug 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
v = [1 2]; s_correct = log10(2); assert(abs(logs(v)-s_correct)<.0001)

Error using assert The condition input argument must be a scalar logical. Error in Test1 (line 3) assert(abs(logs(v)-s_correct)<.0001)

2   Fail
v = 1:20; s_correct = 18.3861; assert(abs(logs(v)-s_correct)<.0001)

Error using assert The condition input argument must be a scalar logical. Error in Test2 (line 3) assert(abs(logs(v)-s_correct)<.0001)

3   Fail
v = [pi 5 7]; s_correct = 2.0412; assert(abs(logs(v)-s_correct)<.0001)

Error using assert The condition input argument must be a scalar logical. Error in Test3 (line 3) assert(abs(logs(v)-s_correct)<.0001)

4   Fail
v = [1 1 2 3 5 8 13 21]; s_correct = 4.8164; assert(abs(logs(v)-s_correct)<.0001)

Error using assert The condition input argument must be a scalar logical. Error in Test4 (line 3) assert(abs(logs(v)-s_correct)<.0001)

5   Fail
v = ones(1,400); s_correct = 0; assert(abs(logs(v)-s_correct)<.0001)

Error using assert The condition input argument must be a scalar logical. Error in Test5 (line 3) assert(abs(logs(v)-s_correct)<.0001)

6   Fail
v = 9:3:99; s_correct = 51.4284; assert(abs(logs(v)-s_correct)<.0001)

Error using assert The condition input argument must be a scalar logical. Error in Test6 (line 3) assert(abs(logs(v)-s_correct)<.0001)

7   Pass