Cody

Solution 1055125

Submitted on 17 Nov 2016 by JAEHYUK WOO
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.9642 0.9579 0.6446 0.7280 0.0294 0.4659 0.1319 0.3520 0.3660 0.7022 0.6858 0.1696 0.8410 0.3202 0.1980 0.1782

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.1660 0.8001 0.8205 0.2939 0.7068 0.0284 0.4776 0.8419

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

ans = 0