Cody

Solution 264895

Submitted on 20 Jun 2013 by Evan
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
%% A = magic(3); mask = logical([0 1 1; 0 1 1; 0 1 1]); y_correct = [1 6; 5 7; 9 2]; assert(isequal(logicalBlock(A,mask),y_correct))
ans = 1 6 5 7 9 2
2   Pass
%% A = magic(4); mask = logical([0 0 0 0; 0 1 1 0; 0 1 1 0; 0 0 0 0]); y_correct = [11 10; 7 6]; assert(isequal(logicalBlock(A,mask),y_correct))
ans = 11 10 7 6
3   Pass
%% A = magic(4); mask = logical([1 1 1 0; 1 1 1 0; 0 0 0 0; 0 0 0 0]); y_correct = [16 2 3; 5 11 10]; assert(isequal(logicalBlock(A,mask),y_correct))
ans = 16 2 3 5 11 10
4   Pass
%% A = magic(5); mask = logical(ones(5)); y_correct = magic(5); assert(isequal(logicalBlock(A,mask),y_correct))
ans = 17 24 1 8 15 23 5 7 14 16 4 6 13 20 22 10 12 19 21 3 11 18 25 2 9