Cody

Solution 1591492

Submitted on 25 Jul 2018 by goc3
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
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))

ans = 7 14 16 13 20 22

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

ans = 8

3   Pass
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))

ans = 64 338 339 357 43 42 377 23 22

4   Pass
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))

ans = 350 355 1645 450 455 1545

5   Pass
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))

ans = 231 336 396 246 43 6 245 8 33