How to generate block toeplitz matrix

조회 수: 6 (최근 30일)
Ali Bulut ÜÇÜNCÜ
Ali Bulut ÜÇÜNCÜ 2015년 10월 16일
편집: Royi Avital 2019년 3월 13일
I want to generate a block toeplitz matrix in MATLAB, that is [A B C; B A B; C B A] , where A B and C are matrices (if they were scalars, the matlab function "toeplitz" would simply work). Does anyone have any simple way to generate such a matrix?
  댓글 수: 1
Matt J
Matt J 2019년 3월 13일
leo cha's comment moved here:
I have problem, for example
if
for i = 1:200
Q(:, :, 1, i) = magic(2);
end
I would like to generate a block toeplitz matrix, where each block is Q(:, :, 1, i),

댓글을 달려면 로그인하십시오.

채택된 답변

Matt J
Matt J 2015년 10월 16일
편집: Matt J 2015년 10월 16일
Q={A,B,C}; %blocks
n=length(Q);
result = cell2mat(Q(toeplitz(1:n)));
  댓글 수: 2
Ali Bulut ÜÇÜNCÜ
Ali Bulut ÜÇÜNCÜ 2015년 10월 17일
편집: Ali Bulut ÜÇÜNCÜ 2015년 10월 17일
What if we have A,B and C matrices in a single matrix? That is D=[A B C];
Royi Avital
Royi Avital 2019년 1월 19일
편집: Royi Avital 2019년 3월 13일
This could be extended to assymetric case.
For instance if we want the upper triangle to be zero we can do something like:
Q = {A, B, C, Z}; %blocks
n = length(Q);
vC = 1:n;
vR = 4 * ones(n, 1); vR(1) = vC(1);
result = cell2mat(Q(toeplitz(vC, vR)));
Where Z is zeros.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by