Cody

Solution 1818116

Submitted on 16 May 2019 by Dani Péter
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 = 4 y = 0 0 0 0 0.7211 0.8357 0.3590 0.2894 0.5676 0.6768 0.8833 0.8229 0.3327 0.0971 0.2958 0.0132 0.2044 0.4336 0.1573 0.0045

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

a = 0 b = 0 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 = 8 b = 1 y = 0 0.2349 0.3820 0.1496 0.0002 0.9703 0.8020 0.7893 0.3548

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

a = 0 b = 1 y = 0