Cody

Solution 373478

Submitted on 21 Dec 2013 by John Joy Kurian
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))
r = 4 c = 4 y = 0 0 0 0 0.4022 0.1577 0.6555 0.6722 0.5622 0.6933 0.3958 0.1641 0.2132 0.4078 0.6251 0.7888 0.5607 0.7568 0.6226 0.1394
2   Pass
%% x = []; y_correct = zeros(1,0); assert(isequal(addrow(x),y_correct))
r = 0 c = 0 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))
r = 8 c = 1 y = 0 0.2966 0.5999 0.7143 0.6568 0.8425 0.8399 0.6912 0.5290
4   Pass
%% x = zeros(0,1); y_correct = 0; assert(isequal(addrow(x),y_correct))
r = 0 c = 1 y = 0