Cody

Solution 1924243

Submitted on 6 Sep 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
r=2; d=3; c=counteradix(r,d); c_correct = {'000' '001' '010' '011' '100' '101' '110' '111'}; assert(isequal(c,c_correct))

ans = '1' ans = '10' ans = '11' ans = '100' ans = '101' ans = '110' ans = '111' ans = '1000' ans = '1001'

Output argument "c" (and maybe others) not assigned during call to "counteradix". Error in Test1 (line 1) r=2; d=3; c=counteradix(r,d);

2   Fail
assert(isequal(counteradix(3,2),{'00' '01' '02' '10' '11' '12' '20' '21' '22'}))

Error using dec2base (line 25) Second argument must be an integer, 2 <= B <= 36. Error in counteradix (line 5) dec2base(i,d-1) Error in Test2 (line 1) assert(isequal(counteradix(3,2),{'00' '01' '02' '10' '11' '12' '20' '21' '22'}))

Suggested Problems

More from this Author100