Cody

Solution 2026003

Submitted on 18 Nov 2019 at 5:37
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]; y_correct = [1 1;1 1]; assert(isequal(matrix_replication(x),y_correct))

2   Pass
x = [1 2;3 4]; y_correct = [1 2 1 2; 3 4 3 4; 1 2 1 2; 3 4 3 4]; assert(isequal(matrix_replication(x),y_correct))

3   Fail
x = [1 2]; y_correct = [1 2 1 2; 1 2 1 2]; assert(isequal(matrix_replication(x),y_correct))

Unable to perform assignment because the indices on the left side are not compatible with the size of the right side. Error in matrix_replication (line 5) y(jj*a-(a-1):jj*a,ii*a-(a-1):ii*a) = x; Error in Test3 (line 3) assert(isequal(matrix_replication(x),y_correct))