Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
n = 1;
max_n = 9;
n_str = '1';
assert(isequal(betterIndexNum(n,max_n),n_str))
L =
49
L =
'%01d'
n_str =
'1'
|
2 | Pass |
n = 1;
max_n = 28;
n_str = '01';
assert(isequal(betterIndexNum(n,max_n),n_str))
L =
50
L =
'%02d'
n_str =
'01'
|
3 | Pass |
n = 28;
max_n = 848984;
n_str = '000028';
assert(isequal(betterIndexNum(n,max_n),n_str))
L =
54
L =
'%06d'
n_str =
'000028'
|
4 | Pass |
n = 10;
max_n = 100;
n_str = '010';
assert(isequal(betterIndexNum(n,max_n),n_str))
L =
51
L =
'%03d'
n_str =
'010'
|
900 Solvers
874 Solvers
404 Solvers
232 Solvers
Create a Multiplication table matrix...
283 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!