function outMat = blockToeplitz(blkMat, blkDim, blkNum)
%Construct block-symmetric Toeplitz matrix
%
% Example:
%
% blkMat = [ones(3), 2*ones(3), 3*ones(3), 4*ones(3)];
% outMat = blockToeplitz(blkMat, 3, 4);
%
blkSize = blkDim^2;
glbIdx = (toeplitz(1:blkNum) - 1) * blkSize;
glbIdx = kron(glbIdx, ones(blkDim));
glbIdx = blockproc(glbIdx, [blkDim, blkDim], ...
@(block_struct) block_struct.data + ...
reshape(1:blkSize, blkDim, blkDim));
outMat = blkMat(glbIdx);
- - - -
主要是使用 toeplitz function,然後再計算 index
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.160.223.55
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 6 之 7 篇):