Cody

Solution 863133

Submitted on 3 Apr 2016 by HH
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.2740 0.1491 0.0826 0.5572 0.8261 0.5671 0.1700 0.2358 0.7976 0.7754 0.7401 0.6883 0.4663 0.9607 0.5011 0.9056

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.5474 0.6857 0.6824 0.2765 0.2272 0.3319 0.7352 0.8988

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

y = 0