Cody

Solution 1742323

Submitted on 4 Mar 2019 by Martin C.
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 = 3; y_correct = [0 0 0; 0 1 0; 0 0 0]; assert(isequal(your_fcn_name(x),y_correct))

le = 3 y = 0 0 0 0 0 0 0 0 0 c = 2 m = 0 m = 1 m = 1 m = 1 m = 1 y = 0 0 0 0 1 0 0 0 0

2   Pass
x = 1; y_correct = 1; assert(isequal(your_fcn_name(x),y_correct))

le = 1 y = 0 c = 1 m = 0 m = 1 m = 1 m = 1 m = 1

3   Pass
x = 5; y_correct = [1 1 1 1 1; 1 0 0 0 1; 1 0 1 0 1; 1 0 0 0 1; 1 1 1 1 1]; assert(isequal(your_fcn_name(x),y_correct))

le = 5 y = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 c = 1 m = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 m = 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 m = 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 m = 1 1 1 1 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 1 1 1 m = 1 1 1 1 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1 1 1 1 1 c = 3 m = 0 m = 1 m = 1 m = 1 m = 1

4   Pass
x = 7; y_correct = [0 0 0 0 0 0 0; 0 1 1 1 1 1 0; 0 1 0 0 0 1 0; 0 1 0 1 0 1 0; 0 1 0 0 0 1 0; 0 1 1 1 1 1 0; 0 0 0 0 0 0 0]; assert(isequal(your_fcn_name(x),y_correct))

le = 7 y = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 c = 2 m = 0 0 0 0 0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