Cody

# Problem 43688. Increment up an input vector

Solution 1552992

Submitted on 7 Jun 2018 by Mehmet OZC
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:10; y_correct = 2:2:20; assert(isequal(f(x),y_correct))

y = 2 4 6 8 10 12 14 16 18 20

2   Pass
x = [0.2400 0.4173 0.0497 0.9027 0.9448 0.4909 0.4893]; y_correct = [1.2400 2.4173 3.0497 4.9027 5.9448 6.4909 7.4893]; assert(isequal(f(x),y_correct))

y = 1.2400 2.4173 3.0497 4.9027 5.9448 6.4909 7.4893

3   Pass
x = [4124 52351 pi i -242]; y_correct = [4125 52353 pi+3 4+i -237]; assert(isequal(f(x),y_correct))

y = 1.0e+04 * 0.4125 + 0.0000i 5.2353 + 0.0000i 0.0006 + 0.0000i 0.0004 + 0.0001i -0.0237 + 0.0000i

4   Pass
x = [7 4 1 5 8 6 9 2 3]; y_correct = [8 6 4 9 13 12 16 10 12]; assert(isequal(f(x),y_correct))

y = 8 6 4 9 13 12 16 10 12

5   Pass
x = -3:3; y_correct = -2:2:10; assert(isequal(f(x),y_correct))

y = -2 0 2 4 6 8 10

6   Pass
x = 10:-1:1; y_correct = 11*ones(1,10); assert(isequal(f(x),y_correct))

y = 11 11 11 11 11 11 11 11 11 11