This solution is outdated. To rescore this solution, sign in.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x = [1 2 3 4 5];
n=2;
y_correct = [1 0 0 2 0 0 3 0 0 4 0 0 5 0 0];
assert(isequal(insert_zeros(x,n),y_correct))
|
2 | Pass |
%%
x = [1 2 3 4 5];
n=1;
y_correct = [1 0 2 0 3 0 4 0 5 0 ];
assert(isequal(insert_zeros(x,n),y_correct))
|
3 | Pass |
%%
x = [1 2];
n=5;
y_correct = [1 0 0 0 0 0 2 0 0 0 0 0];
assert(isequal(insert_zeros(x,n),y_correct))
|
1601 Solvers
1052 Solvers
Calculate the area of a triangle between three points
878 Solvers
583 Solvers
Sum of odd numbers in a matrix
311 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!