Cody

Problem 45491. cross-section of 3D pyramid

Solution 2470283

Submitted on 4 Jun 2020 by Nikolaos Nikolaou
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
n = 1; y_correct = 1; assert(isequal(your_fcn_name(n),y_correct))

t = 1 s = 1×0 empty double row vector xz = 1

2   Pass
n = 7; y_correct = [0 0 0 1 0 0 0; 0 0 1 1 1 0 0; 0 1 1 1 1 1 0; 1 1 1 1 1 1 1]; assert(isequal(your_fcn_name(n),y_correct))

t = 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 s = 0 0 0 0 0 1 0 1 1 1 1 1 xz = 0 0 0 1 0 0 0 0 0 1 1 1 0 0 0 1 1 1 1 1 0 1 1 1 1 1 1 1

3   Pass
n = 6; y_correct = [0 0 1 1 0 0; 0 1 1 1 1 0; 1 1 1 1 1 1]; assert(isequal(your_fcn_name(n),y_correct))

s = 0 0 1 0 1 1 1 1 1 t = 1 0 0 1 1 0 1 1 1 xz = 0 0 1 1 0 0 0 1 1 1 1 0 1 1 1 1 1 1

4   Pass
n = 10; y_correct = [0 0 0 0 1 1 0 0 0 0; 0 0 0 1 1 1 1 0 0 0; 0 0 1 1 1 1 1 1 0 0; 0 1 1 1 1 1 1 1 1 0; 1 1 1 1 1 1 1 1 1 1]; assert(isequal(your_fcn_name(n),y_correct))

s = 0 0 0 0 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 t = 1 0 0 0 0 1 1 0 0 0 1 1 1 0 0 1 1 1 1 0 1 1 1 1 1 xz = 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1