Cody

Solution 1891039

Submitted on 3 Aug 2019 by Nikolaos Nikolaou
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.5357 0.1496 0.9305 0.8673 0.7299 0.7376 0.3133 0.0913 0.3396 0.1581 0.2322 0.2880 0.3900 0.9946 0.9568 0.1448

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.1540 0.9469 0.2987 0.8398 0.8760 0.9752 0.0618 0.7861

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

y = 0