Cody

Solution 923199

Submitted on 14 Jul 2016 by Claudio Gelmi
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.5439 0.1765 0.3895 0.1491 0.6860 0.5242 0.1854 0.9847 0.7099 0.1308 0.1267 0.0160 0.5688 0.5027 0.1679 0.5411

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

y = Empty matrix: 1-by-0

3   Pass
x = rand(8,1); y_correct = [zeros(1,size(x,2));x]; assert(isequal(addrow(x),y_correct))

y = 0 0.1011 0.2148 0.7647 0.7339 0.5714 0.6498 0.6800 0.8090

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

y = 0