Cody

Solution 340959

Submitted on 28 Oct 2013 by Mark Hanus
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))
ans = 0 0 0 0 0.8431 0.1021 0.5015 0.3957 0.0915 0.6560 0.1969 0.1652 0.6722 0.0296 0.5301 0.6952 0.3397 0.2984 0.2133 0.8110
2   Pass
%% x = []; y_correct = zeros(1,0); assert(isequal(addrow(x),y_correct))
ans = 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))
ans = 0 0.0271 0.9211 0.7117 0.6409 0.8544 0.4420 0.9787 0.7485
4   Pass
%% x = zeros(0,1); y_correct = 0; assert(isequal(addrow(x),y_correct))
ans = 0