Cody

Solution 481856

Submitted on 3 Aug 2014
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 = [0 0 0 0 0 0;0 0 0 0 0 0;0 0 1 0 0 0;0 0 1 0 0 0;0 0 0 1 0 0;0 0 0 0 0 0]; y_correct = 1; assert(isequal(block3(x),y_correct))

ans{1} = 0 ans{2} = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 ans{1} = 1 ans{2} = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0

2   Pass
%% x = [0 0 0 0 0 0;0 0 0 0 0 0;0 0 1 0 0 0;0 1 0 0 0 0;0 0 1 0 0 0;0 0 0 0 0 0]; y_correct = 1; assert(isequal(block3(x),y_correct))

ans{1} = 0 ans{2} = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 ans{1} = 1 ans{2} = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0

3   Pass
%% x = [0 0 0 0 0 0;0 0 0 0 0 0;0 0 1 0 0 0;0 0 0 1 0 0;0 0 0 0 1 0;0 0 0 0 0 0]; y_correct = 2; assert(isequal(block3(x),y_correct))

ans{1} = 0 ans{2} = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 ans{1} = 1 ans{2} = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ans{1} = 2 ans{2} = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

4   Fail
%% x = [0 0 0 0 0 0;0 0 1 0 0 0;0 0 0 0 0 0;0 0 1 0 0 0;0 0 0 0 0 0;0 0 1 0 0 0]; y_correct = 2; assert(isequal(block3(x),y_correct))

Error: Assertion failed.

5   Fail
%% x = [0 0 0 0 0 0;0 0 0 0 0 0;0 1 0 1 1 0;0 0 0 0 0 0;0 0 0 0 0 0;0 0 0 0 0 0]; y_correct = 1; assert(isequal(block3(x),y_correct))

Error: Assertion failed.

6   Fail
%% x = [0 0 0 0 0 0;0 0 0 0 0 0;0 0 0 1 1 0;0 0 0 0 0 0;0 0 1 0 0 0;0 0 0 0 0 0]; y_correct = 2; assert(isequal(block3(x),y_correct))

Error: Assertion failed.

7   Fail
%% x = [0 0 0 0 0 0;0 0 0 0 0 0;0 0 0 1 1 0;0 0 0 1 0 0;0 0 0 0 0 0;0 0 0 0 0 0]; y_correct = 2; assert(isequal(block3(x),y_correct))

Error: Index exceeds matrix dimensions.

8   Fail
%% x = [0 0 0 0 0 0;0 0 0 0 0 0;0 0 0 1 0 0;0 0 0 1 1 0;0 0 0 0 0 0;0 0 0 0 0 0]; y_correct = 2; assert(isequal(block3(x),y_correct))

Error: Index exceeds matrix dimensions.

9   Fail
%% x = [0 0 0 0 0 0;0 0 1 0 1 0;0 0 0 0 0 0;0 0 0 0 0 0;0 0 0 1 0 0;0 0 0 0 0 0]; y_correct = 3; assert(isequal(block3(x),y_correct))

Error: Assertion failed.

10   Fail
%% x = [0 0 0 0 0 0;0 0 1 0 1 0;0 0 1 0 0 0;0 0 0 0 0 0;0 0 0 0 0 0;0 0 0 0 0 0]; y_correct = 2; assert(isequal(block3(x),y_correct))

Error: Index exceeds matrix dimensions.