Cody

Solution 1973723

Submitted on 13 Oct 2019
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
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))

y = 1 5 9 6 7 2

Unrecognized function or variable 'm'. Error in logicalBlock (line 4) m(i,:) Error in Test1 (line 4) assert(isequal(logicalBlock(A,mask),y_correct))

2   Fail
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))

y = 11 7 10 6

Unrecognized function or variable 'm'. Error in logicalBlock (line 4) m(i,:) Error in Test2 (line 4) assert(isequal(logicalBlock(A,mask),y_correct))

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

y = 16 5 2 11 3 10

Unrecognized function or variable 'm'. Error in logicalBlock (line 4) m(i,:) Error in Test3 (line 4) assert(isequal(logicalBlock(A,mask),y_correct))

4   Fail
A = magic(5); mask = logical(ones(5)); y_correct = magic(5); assert(isequal(logicalBlock(A,mask),y_correct))

y = 17 23 4 10 11 24 5 6 12 18 1 7 13 19 25 8 14 20 21 2 15 16 22 3 9

Unrecognized function or variable 'm'. Error in logicalBlock (line 4) m(i,:) Error in Test4 (line 4) assert(isequal(logicalBlock(A,mask),y_correct))

Suggested Problems

More from this Author23