Cody

Problem 42501. Toeplitize a matrix

Solution 2611798

Submitted on 25 Jun 2020
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   Fail
A = 100; B = 100; assert(isequal(toeplitize(A),B))

l = 100

Output argument "B" (and maybe others) not assigned during call to "toeplitize". Error in Test1 (line 3) assert(isequal(toeplitize(A),B))

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

l = 0 0 0 0 0 0 2 0 0 l = 0 0 0 1 0 0 0 1 0 l = 6 0 0 6 l = 0 4 0 0

Output argument "B" (and maybe others) not assigned during call to "toeplitize". Error in Test2 (line 3) assert(isequal(toeplitize(A),B))

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

l = 0 0 5 0 l = 4 0 0 4 l = 0 5 0 0 0 5 0 0 0 l = 0 0 9 0 0 0 0 0 0

Output argument "B" (and maybe others) not assigned during call to "toeplitize". Error in Test3 (line 3) assert(isequal(toeplitize(A),B))

4   Fail
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))

l = 0 0 0 0 0 0 3 0 0 l = 0 0 0 5 0 0 0 5 0 l = 7 0 0 0 7 0 0 0 7 l = 0 2 0 0 0 0 2 0 0 0 0 2 0 0 0 0 l = 0 0 2 0 0 0 0 2 0 0 0 0 0 0 0 0 l = 0 0 0 7 0 0 0 0 0 0 0 0 0 0 0 0

Output argument "B" (and maybe others) not assigned during call to "toeplitize". Error in Test4 (line 3) assert(isequal(toeplitize(A),B))

5   Fail
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))

l = 0 0 0 0 0 0 2 0 0 l = 0 0 0 4 0 0 0 4 0 l = 2 0 0 0 2 0 0 0 2 l = 0 3 0 0 0 0 3 0 0 0 0 3 0 0 0 0 l = 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 l = 0 0 0 3 0 0 0 0 0 0 3 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 l = 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 0 0 0 0 0 0 l = 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

Output argument "B" (and maybe others) not assigned during call to "toeplitize". Error in Test5 (line 3) assert(isequal(toeplitize(A),B))

Suggested Problems

More from this Author30