How to generate a hankel and toeplitz array of blocks from three series?

5 ビュー (過去 30 日間)
GTA
GTA 2019 年 7 月 7 日
コメント済み: GTA 2019 年 7 月 7 日
How to generate a matrix of H and a matrix of T, and my matrix to generate these other two has dimension 3x5
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
with the H 4x4 block matrix with columns vectors being
[1 6 11]' [2 7 12]' [3 8 13]' [4 9 14]'
[0 0 0 ]' [1 6 11]' [2 7 12]' [3 8 13]'
[0 0 0 ]' [0 0 0 ]' [1 6 11]' [2 7 12]'
[0 0 0 ]' [0 0 0 ]' [0 0 0 ]' [1 6 11]'
with the T 4x4 block matrix with columns vectors being
[2 7 12]' [3 8 13]' [4 9 14]' [5 10 15]'
[3 8 13]' [4 9 14]' [5 10 15]' [0 0 0 ]'
[4 9 14]' [5 10 15]' [0 0 0 ]' [0 0 0 ]'
[5 10 15]' [0 0 0 ]' [0 0 0 ]' [0 0 0 ]'
Thus, the matrices of H and T have this behavior described in the last two matrices. Thanks any help!
PS:I did a previous post only that I had not considered the block array and Matt J was very kind in helping me, but actually to be able to perform the system ID would have that array of blocks.
In this case as I would for instead of just picking the first row, I get all the row and first column, all rows and second column and so on until the next but last column, in the case of the Toeplitz array
H=hankel(A(1,2:4))
T=triu(toeplitz(A(1,1:3)))

採用された回答

Andrei Bobrov
Andrei Bobrov 2019 年 7 月 7 日
編集済み: Andrei Bobrov 2019 年 7 月 7 日
A = [1 2 3 4 5
6 7 8 9 10
11 12 13 14 15 ];
[m,n] = size(A);
C = num2cell(A,1);
ii = triu(toeplitz(1:n-1));
H = repmat({zeros(m,1)},n-1);
lo = triu(true(n-1));
H(lo) = C(ii(lo))
jj = hankel(2:n);
T = repmat({zeros(m,1)},n-1);
lo = jj > 0;
T(lo) = C(jj(lo))

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by