Cody

Solution 1574970

Submitted on 4 Jul 2018 by David Verrelli
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
x = 1:10; y_correct = {'01';'02';'03';'04';'05';'06';'07';'08';'09';'10'}; assert(isequal(zeroPadding(x),y_correct))

n = 10×2 char array ' 1' ' 2' ' 3' ' 4' ' 5' ' 6' ' 7' ' 8' ' 9' '10' y = 10×1 cell array {' 1'} {' 2'} {' 3'} {' 4'} {' 5'} {' 6'} {' 7'} {' 8'} {' 9'} {'10'} y = 10×1 cell array {'01'} {'02'} {'03'} {'04'} {'05'} {'06'} {'07'} {'08'} {'09'} {'10'}

2   Pass
x = 1:4; y_correct = {'1';'2';'3';'4'}; assert(isequal(zeroPadding(x),y_correct))

n = 4×1 char array '1' '2' '3' '4' y = 4×1 cell array {'1'} {'2'} {'3'} {'4'} y = 4×1 cell array {'1'} {'2'} {'3'} {'4'}

3   Pass
x = 90:100; y_correct = {'090';'091';'092';'093';'094';'095';'096';'097';'098';'099';'100'}; assert(isequal(zeroPadding(x),y_correct))

n = 11×3 char array ' 90' ' 91' ' 92' ' 93' ' 94' ' 95' ' 96' ' 97' ' 98' ' 99' '100' y = 11×1 cell array {' 90'} {' 91'} {' 92'} {' 93'} {' 94'} {' 95'} {' 96'} {' 97'} {' 98'} {' 99'} {'100'} y = 11×1 cell array {'090'} {'091'} {'092'} {'093'} {'094'} {'095'} {'096'} {'097'} {'098'} {'099'} {'100'}

4   Pass
x = [1 4 42 100 7400 99 301 2]; y_correct = {'0001';'0004';'0042';'0100';'7400';'0099';'0301';'0002'}; assert(isequal(zeroPadding(x),y_correct))

n = 8×4 char array ' 1' ' 4' ' 42' ' 100' '7400' ' 99' ' 301' ' 2' y = 8×1 cell array {' 1'} {' 4'} {' 42'} {' 100'} {'7400'} {' 99'} {' 301'} {' 2'} y = 8×1 cell array {'0001'} {'0004'} {'0042'} {'0100'} {'7400'} {'0099'} {'0301'} {'0002'}

Suggested Problems

More from this Author10