Cody

Solution 1697611

Submitted on 20 Dec 2018
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   Fail
x = [1 2 3 4 5] n = 4 y_correct = [1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5] assert(isequal(NplicateMe(x,n),y_correct))

x = 1 2 3 4 5 n = 4 y_correct = 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5

Error using repelem In repelem(v, N), N must be a scalar or a vector of length equal to v. Error in NplicateMe (line 2) y = repelem(x,[1,n]); Error in Test1 (line 4) assert(isequal(NplicateMe(x,n),y_correct))

2   Fail
x = [10 7 8] n = 2 y_correct = [10 10 7 7 8 8] assert(isequal(NplicateMe(x,n),y_correct))

x = 10 7 8 n = 2 y_correct = 10 10 7 7 8 8

Error using repelem In repelem(v, N), N must be a scalar or a vector of length equal to v. Error in NplicateMe (line 2) y = repelem(x,[1,n]); Error in Test2 (line 4) assert(isequal(NplicateMe(x,n),y_correct))

Suggested Problems

More from this Author43