Cody

Solution 1972919

Submitted on 12 Oct 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
x = 0.5; r = 0.999; n = 1; x_correct = 0.5; p_correct = 0.5; [p, x] = f(x, r, n); assert(isequal(p,p_correct)); assert(x==x_correct);

Unrecognized function or variable 'mkd'. Error in f (line 6) mkdir(num2str(mkd)); Error in Test1 (line 6) [p, x] = f(x, r, n);

2   Fail
x = 0.5; r = 0.999; n = 2; x_correct = 0.999; p_correct = [1 0]; [p, x] = f(x, r, n); assert(isequal(p,p_correct)); assert(x==x_correct);

Unrecognized function or variable 'mkd'. Error in f (line 6) mkdir(num2str(mkd)); Error in Test2 (line 6) [p, x] = f(x, r, n);

3   Fail
x = 0.5; r = 0.999; n = 3; x_correct = 0.00399; p_correct = [-4 4 0 0]; [p, x] = f(x, r, n); assert(isequal(p,p_correct)); assert(abs(x-x_correct)<1E-5);

Unrecognized function or variable 'mkd'. Error in f (line 6) mkdir(num2str(mkd)); Error in Test3 (line 6) [p, x] = f(x, r, n);

4   Fail
x = 0.5; r = 0.999; n = 5; x_correct = 0.06248; [p, x] = f(x, r, n); assert(isequal(p(1:3),[-16384 65536 -98304])); assert(abs(x-x_correct)<1E-5);

Unrecognized function or variable 'mkd'. Error in f (line 6) mkdir(num2str(mkd)); Error in Test4 (line 5) [p, x] = f(x, r, n);

5   Fail
x = 0.5; r = 0.999; n = 6; x_correct = 0.23407; [p, x] = f(x, r, n); assert(abs(sum(p(1:3))+2.25485E10)<1E5); assert(abs(x-x_correct)<1E-5);

Unrecognized function or variable 'mkd'. Error in f (line 6) mkdir(num2str(mkd)); Error in Test5 (line 5) [p, x] = f(x, r, n);

6   Fail
x = 0.5; r = 0.9999; n = 7; x_correct = 0.09891; [p, x] = f(x, r, n); assert(abs(sum(p))<1E5); assert(abs(x-x_correct)<1E-5);

Unrecognized function or variable 'mkd'. Error in f (line 6) mkdir(num2str(mkd)); Error in Test6 (line 5) [p, x] = f(x, r, n);