Cody

Problem 2250. Given a number find two variables

Solution 1992679

Submitted on 27 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 = 10; y_correct = [0.625 4]; assert(isequal(extract(x),y_correct))

b = 4 a = 0.6250

Output argument "y_correct" (and maybe others) not assigned during call to "extract". Error in Test1 (line 3) assert(isequal(extract(x),y_correct))

2   Fail
x = 3.1416; y_correct = [0.7854 2]; assert( abs(sum(extract(x) - y_correct)) < 0.0001)

b = 2 a = 0.7854

Output argument "y_correct" (and maybe others) not assigned during call to "extract". Error in Test2 (line 3) assert( abs(sum(extract(x) - y_correct)) < 0.0001)

3   Fail
x = -3; y_correct = [-0.7500 2]; assert( abs(sum(extract(x) - y_correct)) < 0.0001)

b = 0 a = -3

Output argument "y_correct" (and maybe others) not assigned during call to "extract". Error in Test3 (line 3) assert( abs(sum(extract(x) - y_correct)) < 0.0001)

4   Fail
x = realmax('single'); y_correct = [1 128]; assert( abs(sum(extract(x) - y_correct)) < 0.0001)

b = 128 a = single 1.0000

Output argument "y_correct" (and maybe others) not assigned during call to "extract". Error in Test4 (line 3) assert( abs(sum(extract(x) - y_correct)) < 0.0001)

5   Fail
x = 0; y_correct = [0 0]; assert(isequal(extract(x),y_correct))

b = 0 a = 0

Output argument "y_correct" (and maybe others) not assigned during call to "extract". Error in Test5 (line 3) assert(isequal(extract(x),y_correct))