Cody

# Problem 42501. Toeplitize a matrix

Solution 2925508

Submitted on 8 Sep 2020 by aanotAA
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(toeplitize(A),B))

B = 100

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

B = 6 0 0 0 0 0 B = 6 0 1 0 0 0 B = 6 0 1 0 2 0 B = 6 4 1 0 2 0 B = 6 4 1 6 2 0 B = 6 4 1 6 2 1

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

B = 4 0 0 0 0 0 B = 4 0 0 5 0 0 B = 4 5 0 5 0 0 B = 4 5 0 5 4 0 B = 4 5 9 5 4 0 B = 4 5 9 5 4 5

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

B = 7 0 0 0 0 0 0 0 0 0 0 0 B = 7 0 0 0 5 0 0 0 0 0 0 0 B = 7 0 0 0 5 0 0 0 3 0 0 0 B = 7 2 0 0 5 0 0 0 3 0 0 0 B = 7 2 0 0 5 7 0 0 3 0 0 0 B = 7 2 0 0 5 7 0 0 3 5 0 0 B = 7 2 2 0 5 7 0 0 3 5 0 0 B = 7 2 2 0 5 7 2 0 3 5 0 0 B = 7 2 2 0 5 7 2 0 3 5 7 0 B = 7 2 2 7 5 7 2 0 3 5 7 0 B = 7 2 2 7 5 7 2 2 3 5 7 0 B = 7 2 2 7 5 7 2 2 3 5 7 2

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

B = 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 B = 2 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 B = 2 0 0 0 0 0 4 0 0 0 0 0 2 0 0 0 0 0 B = 2 3 0 0 0 0 4 0 0 0 0 0 2 0 0 0 0 0 B = 2 3 0 0 0 0 4 2 0 0 0 0 2 0 0 0 0 0 B = 2 3 0 0 0 0 4 2 0 0 0 0 2 4 0 0 0 0 B = 2 3 -3 0 0 0 4 2 0 0 0 0 2 4 0 0 0 0 B = 2 3 -3 0 0 0 4 2 3 0 0 0 2 4 0 0 0 0 B = 2 3 -3 0 0 0 4 2 3 0 0 0 2 4 2 0 0 0 B = 2 3 -3 3 0 0 4 2 3 0 0 0 2 4 2 0 0 0 B = 2 3 -3 3 0 0 4 2 3 -3 0 0 2 4 2 0 0 0 B = 2 3 -3 3 0 0 4 2 3 -3 0 0 2 4 2 3 0 0 B = 2 3 -3 3 2 0 4 2 3 -3 0 0 2 4 2 3 0 0 B = 2 3 -3 3 2 0 4 2 3 -3 3 0 2 4 2 3 0 0 B = 2 3 -3 3 2 0 4 2 3 -3 3 0 2 4 2 3 -3 0 B = 2 3 -3 3 2 2 4 2 3 -3 3 0 2 4 2 3 -3 0 B = 2 3 -3 3 2 2 4 2 3 -3 3 2 2 4 2 3 -3 0 B = 2 3 -3 3 2 2 4 2 3 -3 3 2 2 4 2 3 -3 3

### Community Treasure Hunt

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

Start Hunting!