Cody

# Problem 1024. Doubling elements in a vector

Solution 1898411

Submitted on 12 Aug 2019 by John Johni
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]; assert(isequal(your_fcn_name(x),y_correct))

t = 1 B = 1 t = 2 B = 1 1 t = 3

2   Pass
x = [0 -1 1 0 0 0 1 2]; y_correct = [0 0 -1 -1 1 1 0 0 0 0 0 0 1 1 2 2]; assert(isequal(your_fcn_name(x),y_correct))

t = 1 B = 0 t = 2 B = 0 0 t = 3 B = 0 0 -1 t = 4 B = 0 0 -1 -1 t = 5 B = 0 0 -1 -1 1 t = 6 B = 0 0 -1 -1 1 1 t = 7 B = 0 0 -1 -1 1 1 0 t = 8 B = 0 0 -1 -1 1 1 0 0 t = 9 B = 0 0 -1 -1 1 1 0 0 0 t = 10 B = 0 0 -1 -1 1 1 0 0 0 0 t = 11 B = 0 0 -1 -1 1 1 0 0 0 0 0 t = 12 B = 0 0 -1 -1 1 1 0 0 0 0 0 0 t = 13 B = 0 0 -1 -1 1 1 0 0 0 0 0 0 1 t = 14 B = 0 0 -1 -1 1 1 0 0 0 0 0 0 1 1 t = 15 B = 0 0 -1 -1 1 1 0 0 0 0 0 0 1 1 2 t = 16 B = 0 0 -1 -1 1 1 0 0 0 0 0 0 1 1 2 2 t = 17

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!