Cody

# Problem 3094. Hankelize a matrix

Solution 3042694

Submitted on 3 Oct 2020 by mohsen
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
A = 100; B = 100; assert(isequal(hankelize(A),B));

f = 100 d = 100 no = 1 m = 100 cat = 100 b = 100 di = 100 answer = 100 B = 100

2   Pass
A = [2,0 2,3 9,4]; B = [2,1 1,6 6,4]; assert(isequal(hankelize(A),B));

f = 0 2 3 2 4 9 d = 4 no = 1 m = 4 cat = 4 b = 4 di = 0 0 0 0 0 0 4 0 0 di = 0 0 0 0 4 0 answer = 0 0 0 0 4 0 B = 0 0 0 0 0 4 d = 3 9 no = 2 m = 6 cat = 6 cat = 6 6 b = 6 6 di = 0 0 0 6 0 0 0 6 0 di = 0 0 6 0 0 6 answer = 0 0 6 0 4 6 B = 0 0 0 6 6 4 d = 0 2 no = 2 m = 1 cat = 1 cat = 1 1 b = 1 1 di = 1 0 0 1 di = 1 0 0 1 0 0 answer = 1 0 6 1 4 6 B = 0 1 1 6 6 4 d = 2 no = 1 m = 2 cat = 2 b = 2 di = 0 2 0 0 di = 0 2 0 0 0 0 answer = 1 2 6 1 4 6 B = 2 1 1 6 6 4

3   Pass
A = [5 1 0 7 10 9]; B = [5 4 5 4 5 9]; assert(isequal(hankelize(A),B));

f = 0 1 5 9 10 7 d = 9 no = 1 m = 9 cat = 9 b = 9 di = 0 0 9 0 di = 0 0 0 9 0 0 answer = 0 0 0 9 0 0 B = 0 0 0 0 0 9 d = 0 10 no = 2 m = 5 cat = 5 cat = 5 5 b = 5 5 di = 5 0 0 5 di = 5 0 0 0 5 0 answer = 5 0 0 9 5 0 B = 0 0 5 0 5 9 d = 1 7 no = 2 m = 4 cat = 4 cat = 4 4 b = 4 4 di = 0 4 0 0 0 4 0 0 0 di = 0 4 0 0 0 4 answer = 5 4 0 9 5 4 B = 0 4 5 4 5 9 d = 5 no = 1 m = 5 cat = 5 b = 5 di = 0 0 5 0 0 0 0 0 0 di = 0 0 5 0 0 0 answer = 5 4 5 9 5 4 B = 5 4 5 4 5 9

4   Pass
A = [3 7 10 2 3 5 1 2 6 3 2 7]; B = [3 5 7 2 5 7 2 2 7 2 2 7]; assert(isequal(hankelize(A),B));

f = 2 10 7 3 2 1 5 3 7 2 3 6 d = 7 no = 1 m = 7 cat = 7 b = 7 di = 0 0 0 0 0 0 7 0 0 di = 0 0 0 0 0 0 0 0 7 0 0 0 answer = 0 0 0 0 0 0 0 0 7 0 0 0 B = 0 0 0 0 0 0 0 0 0 0 0 7 d = 2 2 no = 2 m = 2 cat = 2 cat = 2 2 b = 2 2 di = 0 0 0 2 0 0 0 2 0 di = 0 0 0 0 2 0 0 0 0 2 0 0 answer = 0 0 0 0 2 0 0 0 7 2 0 0 B = 0 0 0 0 0 0 0 2 0 0 2 7 d = 2 1 3 no = 3 m = 2 cat = 2 cat = 2 2 cat = 2 2 2 b = 2 2 2 di = 2 0 0 0 2 0 0 0 2 di = 2 0 0 0 0 2 0 0 0 0 2 0 answer = 2 0 0 0 2 2 0 0 7 2 2 0 B = 0 0 0 2 0 0 2 2 0 2 2 7 d = 10 5 6 no = 3 m = 7 cat = 7 cat = 7 7 cat = 7 7 7 b = 7 7 7 di = 0 7 0 0 0 0 7 0 0 0 0 7 0 0 0 0 di = 0 7 0 0 0 0 7 0 0 0 0 7 answer = 2 7 0 0 2 2 7 0 7 2 2 7 B = 0 0 7 2 0 7 2 2 7 2 2 7 d = 7 3 no = 2 m = 5 cat = 5 cat = 5 5 b = 5 5 di = 0 0 5 0 0 0 0 5 0 0 0 0 0 0 0 0 di = 0 0 5 0 0 0 0 5 0 0 0 0 answer = 2 7 5 0 2 2 7 5 7 2 2 7 B = 0 5 7 2 5 7 2 2 7 2 2 7 d = 3 no = 1 m = 3 cat = 3 b = 3 di = 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 di = 0 0 0 3 0 0 0 0 0 0 0 0 answer = 2 7 5 3 2 2 7 5 7 2 2 7 B = 3 5 7 2 5 7 2 2 7 2 2 7

5   Pass
A = [2 0 -1 10 -3 6 8 4 0 4 2 0 3 -1 -10 1 4 2]; B = [2 4 2 3 -3 3 4 2 3 -3 3 2 2 3 -3 3 2 2]; assert(isequal(hankelize(A),B));

f = 6 -3 10 -1 0 2 0 2 4 0 4 8 2 4 1 -10 -1 3 d = 2 no = 1 m = 2 cat = 2 b = 2 di = 0 0 0 0 0 0 2 0 0 di = 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 answer = 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 B = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 d = 0 4 no = 2 m = 2 cat = 2 cat = 2 2 b = 2 2 di = 0 0 0 2 0 0 0 2 0 di = 0 0 0 0 0 0 2 0 0 0 0 0 0 2 0 0 0 0 answer = 0 0 0 0 0 0 2 0 0 0 0 0 2 2 0 0 0 0 B = 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 2 2 d = 6 2 1 no = 3 m = 3 cat = 3 cat = 3 3 cat = 3 3 3 b = 3 3 3 di = 3 0 0 0 3 0 0 0 3 di = 3 0 0 0 0 0 0 3 0 0 0 0 0 0 3 0 0 0 answer = 3 0 0 0 0 0 2 3 0 0 0 0 2 2 3 0 0 0 B = 0 0 0 0 0 3 0 0 0 0 3 2 0 0 0 3 2 2 d = -3 4 -10 no = 3 m = -3 cat = -3 cat = -3 -3 cat = -3 -3 -3 b = -3 -3 -3 di = 0 -3 0 0 0 0 -3 0 0 0 0 -3 0 0 0 0 di = 0 -3 0 0 0 0 -3 0 0 0 0 -3 di = 0 -3 0 0 0 0 0 0 -3 0 0 0 0 0 0 -3 0 0 answer = 3 -3 0 0 0 0 2 3 -3 0 0 0 2 2 3 -3 0 0 B = 0 0 0 0 -3 3 0 0 0 -3 3 2 0 0 -3 3 2 2 d = 10 0 -1 no = 3 m = 3 cat = 3 cat = 3 3 cat = 3 3 3 b = 3 3 3 di = 0 0 3 0 0 0 0 0 3 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 di = 0 0 3 0 0 0 0 0 3 0 0 0 0 0 3 di = 0 0 3 0 0 0 0 0 0 3 0 0 0 0 0 0 3 0 answer = 3 -3 3 0 0 0 2 3 -3 3 0 0 2 2 3 -3 3 0 B = 0 0 0 3 -3 3 0 0 3 -3 3 2 0 3 -3 3 2 2 d = -1 4 3 no = 3 m = 2 cat = 2 cat = 2 2 cat = 2 2 2 b = 2 2 2 di = 0 0 0 2 0 0 0 0 0 0 2 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 di = 0 0 0 2 0 0 0 0 0 0 2 0 0 0 0 0 0 2 answer = 3 -3 3 2 0 0 2 3 -3 3 2 0 2 2 3 -3 3 2 B = 0 0 2 3 -3 3 0 2 3 -3 3 2 2 3 -3 3 2 2 d = 0 8 no = 2 m = 4 cat = 4 cat = 4 4 b = 4 4 di = 0 0 0 0 4 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 di = 0 0 0 0 4 0 0 0 0 0 0 4 0 0 0 0 0 0 answer = 3 -3 3 2 4 0 2 3 -3 3 2 4 2 2 3 -3 3 2 B = 0 4 2 3 -3 3 4 2 3 -3 3 2 2 3 -3 3 2 2 d = 2 no = 1 m = 2 cat = 2 b = 2 di = 0 0 0 0 0 2 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 di = 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 answer = 3 -3 3 2 4 2 2 3 -3 3 2 4 2 2 3 -3 3 2 B = 2 4 2 3 -3 3 4 2 3 -3 3 2 2 3 -3 3 2 2

### Community Treasure Hunt

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

Start Hunting!