Cody

# Problem 444. count any radix?

Solution 2199042

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

c = 1×1 cell array {'000'} c = 1×2 cell array {'000'} {'001'} c = 1×3 cell array {'000'} {'001'} {'010'} c = 1×4 cell array {'000'} {'001'} {'010'} {'011'} c = 1×5 cell array {'000'} {'001'} {'010'} {'011'} {'100'} c = 1×6 cell array {'000'} {'001'} {'010'} {'011'} {'100'} {'101'} c = 1×7 cell array {'000'} {'001'} {'010'} {'011'} {'100'} {'101'} {'110'} c = 1×8 cell array {'000'} {'001'} {'010'} {'011'} {'100'} {'101'} {'110'} {'111'}

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

c = 1×1 cell array {'00'} c = 1×2 cell array {'00'} {'01'} c = 1×3 cell array {'00'} {'01'} {'02'} c = 1×4 cell array {'00'} {'01'} {'02'} {'10'} c = 1×5 cell array {'00'} {'01'} {'02'} {'10'} {'11'} c = 1×6 cell array {'00'} {'01'} {'02'} {'10'} {'11'} {'12'} c = 1×7 cell array {'00'} {'01'} {'02'} {'10'} {'11'} {'12'} {'20'} c = 1×8 cell array {'00'} {'01'} {'02'} {'10'} {'11'} {'12'} {'20'} {'21'} c = 1×9 cell array {'00'} {'01'} {'02'} {'10'} {'11'} {'12'} {'20'} {'21'} {'22'}

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!