Cody

Solution 1655689

Submitted on 22 Oct 2018 by Wycliff Dembe
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 = rand(4); y_correct = [zeros(1,size(x,2));x]; assert(isequal(addrow(x),y_correct))

ans = 0 0 0 0 0.7378 0.8546 0.5138 0.5345 0.4275 0.2238 0.8244 0.2704 0.2631 0.8106 0.9091 0.4067 0.9864 0.7266 0.9881 0.4587

2   Pass
x = []; y_correct = zeros(1,0); assert(isequal(addrow(x),y_correct))

ans = 1×0 empty double row vector

3   Pass
x = rand(8,1); y_correct = [zeros(1,size(x,2));x]; assert(isequal(addrow(x),y_correct))

ans = 0 0.6541 0.1876 0.8825 0.1458 0.0926 0.3073 0.2111 0.8878

4   Pass
x = zeros(0,1); y_correct = 0; assert(isequal(addrow(x),y_correct))

ans = 0