Cody

Solution 1746503

Submitted on 9 Mar 2019 by nag
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   Pass
v = [1 2]; s_correct = log10(2); assert(abs(logs(v)-s_correct)<.0001)

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

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

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

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

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

7   Pass
filetext = fileread('logs.m'); assert(isempty(strfind(filetext,'sum')))