Cody

Solution 2329403

Submitted on 22 May 2020 by Laza Álmos
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))

a = 4 b = 0 0 0 0 y = 0 0 0 0 0.4576 0.0766 0.9990 0.3647 0.6623 0.0544 0.2034 0.5379 0.9823 0.6506 0.7028 0.1271 0.4401 0.1596 0.6537 0.5616

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

a = 0 b = 1×0 empty double row vector 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))

a = 1 b = 0 y = 0 0.8381 0.2646 0.1364 0.3589 0.3475 0.7657 0.3412 0.6975

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

a = 1 b = 0 y = 0