Cody

# Problem 1422. frame of the matrix

Solution 1502878

Submitted on 24 Apr 2018 by Yair Fridman
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 = eye(9); y = [1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1]; assert(isequal(external_frame(x),y))

y = 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 y = 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 y = 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1

2   Pass
x = magic(7); y = [47 7 9 18 27 6 8 17 26 35 14 16 25 34 36 15 24 33 42 44 23 32 41 43 3]; assert(isequal(external_frame(x),y))

y = 30 39 48 1 10 19 28 38 47 7 9 18 27 29 46 6 8 17 26 35 37 5 14 16 25 34 36 45 13 15 24 33 42 44 4 21 23 32 41 43 3 12 22 31 40 49 2 11 20 y = 39 48 1 10 19 47 7 9 18 27 6 8 17 26 35 14 16 25 34 36 15 24 33 42 44 23 32 41 43 3 31 40 49 2 11 y = 47 7 9 18 27 6 8 17 26 35 14 16 25 34 36 15 24 33 42 44 23 32 41 43 3

3   Pass
x = ones(2,2); y = []; assert(isequal(external_frame(x),y))

y = 1 1 1 1 y = 2×0 empty double matrix y = []

4   Pass
x = zeros(2,2); y = []; assert(isequal(external_frame(x),y))

y = 0 0 0 0 y = 2×0 empty double matrix y = []

5   Pass
x = eye(3); y = 1; assert(isequal(external_frame(x),y))

y = 1 0 0 0 1 0 0 0 1 y = 0 1 0 y = 1

6   Pass
x = ones(6,8); y = ones(4,6); assert(isequal(external_frame(x),y))

y = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 y = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 y = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

7   Pass
x = 1; y = []; assert(isequal(external_frame(x),y))

y = 1 y = 1×0 empty double row vector y = []

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!