Cody

Solution 341889

Submitted on 29 Oct 2013 by Rahul Shinde
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))
m = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 m = 0 0 0 0 0.5524 0.3855 0.0312 0.0951 0.3994 0.4295 0.4184 0.0393 0.4816 0.8609 0.4288 0.7388 0.4219 0.5265 0.5598 0.5927
2   Pass
%% x = []; y_correct = zeros(1,0); assert(isequal(addrow(x),y_correct))
m = Empty matrix: 1-by-0 m = 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))
m = 0 0 0 0 0 0 0 0 0 m = 0 0.8218 0.8301 0.2624 0.7715 0.9989 0.2370 0.4430 0.1809
4   Pass
%% x = zeros(0,1); y_correct = 0; assert(isequal(addrow(x),y_correct))
m = 0 m = 0