Cody

Solution 1944168

Submitted on 20 Sep 2019 by Ngo Minh Ngoc
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.0355 0.3397 0.3544 0.1271 0.8433 0.3350 0.1040 0.9106 0.2504 0.3694 0.0873 0.1206 0.8451 0.5507 0.9315 0.7717

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.2702 0.2327 0.9530 0.2435 0.8611 0.8758 0.5917 0.1544

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

y = 0