Cody

# Problem 43654. Replicate and Tile an Array

Solution 1623978

Submitted on 7 Sep 2018 by Michael Jarboe
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
A = [1 2 3; 4 5 6; 7 8 9;] m = 1 n = 2 B_correct = [ 1 2 3 1 2 3; 4 5 6 4 5 6; 7 8 9 7 8 9]; assert(isequal(Epli_and_Tile(A,m,n),B_correct))

A = 1 2 3 4 5 6 7 8 9 m = 1 n = 2 A = 1 2 3 1 4 5 6 4 7 8 9 7 A = 1 2 3 1 2 4 5 6 4 5 7 8 9 7 8 A = 1 2 3 1 2 3 4 5 6 4 5 6 7 8 9 7 8 9

2   Pass
A = magic(4); m = 2 n = 3 B_correct = [16 2 3 13 16 2 3 13 16 2 3 13; 5 11 10 8 5 11 10 8 5 11 10 8; 9 7 6 12 9 7 6 12 9 7 6 12; 4 14 15 1 4 14 15 1 4 14 15 1; 16 2 3 13 16 2 3 13 16 2 3 13; 5 11 10 8 5 11 10 8 5 11 10 8; 9 7 6 12 9 7 6 12 9 7 6 12; 4 14 15 1 4 14 15 1 4 14 15 1] assert(isequal(Epli_and_Tile(A,m,n),B_correct))

m = 2 n = 3 B_correct = 16 2 3 13 16 2 3 13 16 2 3 13 5 11 10 8 5 11 10 8 5 11 10 8 9 7 6 12 9 7 6 12 9 7 6 12 4 14 15 1 4 14 15 1 4 14 15 1 16 2 3 13 16 2 3 13 16 2 3 13 5 11 10 8 5 11 10 8 5 11 10 8 9 7 6 12 9 7 6 12 9 7 6 12 4 14 15 1 4 14 15 1 4 14 15 1 A = 16 2 3 13 16 5 11 10 8 5 9 7 6 12 9 4 14 15 1 4 A = 16 2 3 13 16 2 5 11 10 8 5 11 9 7 6 12 9 7 4 14 15 1 4 14 A = 16 2 3 13 16 2 3 5 11 10 8 5 11 10 9 7 6 12 9 7 6 4 14 15 1 4 14 15 A = 16 2 3 13 16 2 3 13 5 11 10 8 5 11 10 8 9 7 6 12 9 7 6 12 4 14 15 1 4 14 15 1 A = 16 2 3 13 16 2 3 13 16 5 11 10 8 5 11 10 8 5 9 7 6 12 9 7 6 12 9 4 14 15 1 4 14 15 1 4 A = 16 2 3 13 16 2 3 13 16 2 5 11 10 8 5 11 10 8 5 11 9 7 6 12 9 7 6 12 9 7 4 14 15 1 4 14 15 1 4 14 A = 16 2 3 13 16 2 3 13 16 2 3 5 11 10 8 5 11 10 8 5 11 10 9 7 6 12 9 7 6 12 9 7 6 4 14 15 1 4 14 15 1 4 14 15 A = 16 2 3 13 16 2 3 13 16 2 3 13 5 11 10 8 5 11 10 8 5 11 10 8 9 7 6 12 9 7 6 12 9 7 6 12 4 14 15 1 4 14 15 1 4 14 15 1 A = 16 2 3 13 16 2 3 13 16 2 3 13 5 11 10 8 5 11 10 8 5 11 10 8 9 7 6 12 9 7 6 12 9 7 6 12 4 14 15 1 4 14 15 1 4 14 15 1 16 2 3 13 16 2 3 13 16 2 3 13 A = 16 2 3 13 16 2 3 13 16 2 3 13 5 11 10 8 5 11 10 8 5 11 10 8 9 7 6 12 9 7 6 12 9 7 6 12 4 14 15 1 4 14 15 1 4 14 15 1 16 2 3 13 16 2 3 13 16 2 3 13 5 11 10 8 5 11 10 8 5 11 10 8 A = 16 2 3 13 16 2 3 13 16 2 3 13 5 11 10 8 5 11 10 8 5 11 10 8 9 7 6 12 9 7 6 12 9 7 6 12 4 14 15 1 4 14 15 1 4 14 15 1 16 2 3 13 16 2 3 13 16 2 3 13 5 11 10 8 5 11 10 8 5 11 10 8 9 7 6 12 9 7 6 12 9 7 6 12 A = 16 2 3 13 16 2 3 13 16 2 3 13 5 11 10 8 5 11 10 8 5 11 10 8 9 7 6 12 9 7 6 12 9 7 6 12 4 14 15 1 4 14 15 1 4 14 15 1 16 2 3 13 16 2 3 13 16 2 3 13 5 11 10 8 5 11 10 8 5 11 10 8 9 7 6 12 9 7 6 12 9 7 6 12 4 14 15 1 4 14 15 1 4 14 15 1

3   Pass
A = eye(2,3); m = 1 n = 5 B_correct = [1 0 0 1 0 0 1 0 0 1 0 0 1 0 0; 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0] assert(isequal(Epli_and_Tile(A,m,n),B_correct))

m = 1 n = 5 B_correct = 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 A = 1 0 0 1 0 1 0 0 A = 1 0 0 1 0 0 1 0 0 1 A = 1 0 0 1 0 0 0 1 0 0 1 0 A = 1 0 0 1 0 0 1 0 1 0 0 1 0 0 A = 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 A = 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 A = 1 0 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 A = 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 A = 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 A = 1 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 A = 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 A = 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0