Cody

# Problem 1958. Add a row of zeros on top of a matrix

Solution 1709329

Submitted on 18 Jan 2019 by Siripuram Vijay Kumar
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.4138 0.9126 0.7103 0.7038 0 0 0 0 0 0 0 0 0 0 0 0 y = 0 0 0 0 0.4138 0.9126 0.7103 0.7038 0.2722 0.6672 0.8317 0.3036 0 0 0 0 0 0 0 0 y = 0 0 0 0 0.4138 0.9126 0.7103 0.7038 0.2722 0.6672 0.8317 0.3036 0.2490 0.3321 0.0850 0.4755 0 0 0 0 y = 0 0 0 0 0.4138 0.9126 0.7103 0.7038 0.2722 0.6672 0.8317 0.3036 0.2490 0.3321 0.0850 0.4755 0.3112 0.7755 0.1989 0.5819

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

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

y = 0 0.9224 0 0 0 0 0 0 0 y = 0 0.9224 0.4367 0 0 0 0 0 0 y = 0 0.9224 0.4367 0.6152 0 0 0 0 0 y = 0 0.9224 0.4367 0.6152 0.2262 0 0 0 0 y = 0 0.9224 0.4367 0.6152 0.2262 0.8526 0 0 0 y = 0 0.9224 0.4367 0.6152 0.2262 0.8526 0.6504 0 0 y = 0 0.9224 0.4367 0.6152 0.2262 0.8526 0.6504 0.6156 0 y = 0 0.9224 0.4367 0.6152 0.2262 0.8526 0.6504 0.6156 0.1107

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