Re: [討論] 如何將區塊矩陣重排

看板MATLAB作者 ( )時間11年前 (2013/02/06 20:04), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串6/7 (看更多)
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
文章代碼(AID): #1H4aQrPg (MATLAB)
討論串 (同標題文章)
文章代碼(AID): #1H4aQrPg (MATLAB)