Cody

Solution 447711

Submitted on 30 May 2014 by Clemens Giegerich
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.2729 0.4517 0.7727 0.0924 0.0372 0.6099 0.6964 0.0078 0.6733 0.0594 0.1253 0.4231 0.4296 0.3158 0.1302 0.6556
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.7229 0.5312 0.1088 0.6318 0.1265 0.1343 0.0986 0.1420
4   Pass
%% x = zeros(0,1); y_correct = 0; assert(isequal(addrow(x),y_correct))
ans = 0