Cody

Problem 43688. Increment up an input vector

Solution 1063946

Submitted on 28 Nov 2016
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Fail
x = 1:10; y_correct = 2:2:20; assert(isequal(f(x),y_correct))

y = 2 3 4 5 6 7 8 9 10

Assertion failed.

2   Fail
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.2400 3.2400 4.2400 5.2400 6.2400

Assertion failed.

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

y = 1×0 empty double row vector

Assertion failed.