Cody

Solution 1434977

Submitted on 6 Feb 2018
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   Fail
m = magic(5); n = ones(2,3); o = [2 3]; y_correct = [7,14,16;13,20,22]; assert(isequal(cookiecutter(m,n,o),y_correct))

Assertion failed.

2   Pass
m = 1; n = 8; o = [1 1]; y_correct = 8; assert(isequal(cookiecutter(m,n,o),y_correct))

3   Fail
m = magic(20); n = ones(3); o = [17 17]; y_correct = [64,338,339;357,43,42;377,23,22]; assert(isequal(cookiecutter(m,n,o),y_correct))

Error using .* Matrix dimensions must agree. Error in cookiecutter (line 4) y = y.*mn; Error in Test3 (line 5) assert(isequal(cookiecutter(m,n,o),y_correct))

4   Fail
m = magic(20); n = 5.*ones(2,3); o = [4 10]; y_correct = [350,355,1645;450,455,1545]; assert(isequal(cookiecutter(m,n,o),y_correct))

Error using .* Matrix dimensions must agree. Error in cookiecutter (line 4) y = y.*mn; Error in Test4 (line 5) assert(isequal(cookiecutter(m,n,o),y_correct))

5   Fail
m = magic(7); m=m(:,1:end-1); n = spiral(3); o = [5 4]; y_correct = [231,336,396;246,43,6;245,8,33]; assert(isequal(cookiecutter(m,n,o),y_correct))

Error using .* Matrix dimensions must agree. Error in cookiecutter (line 4) y = y.*mn; Error in Test5 (line 6) assert(isequal(cookiecutter(m,n,o),y_correct))