Cody

Solution 1398966

Submitted on 30 Dec 2017 by Eric Lee
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.4709 0.3984 0.8964 0.6193 0.8183 0.4354 0.7472 0.2553 0.7038 0.8318 0.7670 0.7482 0.4913 0.1114 0.0244 0.7877

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.4087 0.7605 0.6566 0.9016 0.8924 0.2373 0.9221 0.7253

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

y = 0