Cody

Solution 1584709

Submitted on 16 Jul 2018 by Martin C.
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))

y = 0 0 0 0 0.2583 0.6811 0.3365 0.2682 0.4736 0.9424 0.8734 0.1143 0.2109 0.0569 0.3484 0.4192 0.8625 0.3894 0.4051 0.2812

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

y = 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))

y = 0 0.7745 0.8872 0.1334 0.8210 0.7542 0.8296 0.1061 0.6040

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

y = 0