필터 지우기
필터 지우기

How can i use toeplitz in cell arrays?

조회 수: 1 (최근 30일)
Gn Gnk
Gn Gnk 2020년 12월 8일
답변: Roee Ronkin 2023년 4월 19일
Hello ,
i have 1x38 cell matrix and every cell contains a 38x38 matrix .I want to perform toeplitz() on this cell array but matlab cannot do that .
For example if my cell array is G then i want to create this toeplitz matrix :
G_toeplitz = [G{1} 0 0 0
G{2} G{1} 0 0
G{3} G{2} G{1} 0
G{4} G{3} G{2} G{1} .......
.
.
.
]
Is there any way to do this?

답변 (2개)

Stephan
Stephan 2020년 12월 8일
편집: Stephan 2020년 12월 8일
G = cell(1,2);
G{1} = ones(2);
G{2} = 2*ones(2);
c = [G{1} G{2}];
r = [G{1} zeros(2)];
result = toeplitz(c,r)
results in:
result =
1 1 1 1 0 0 0 0
1 1 1 1 1 0 0 0
1 1 1 1 1 1 0 0
1 1 1 1 1 1 1 0
2 1 1 1 1 1 1 1
2 2 1 1 1 1 1 1
2 2 2 1 1 1 1 1
2 2 2 2 1 1 1 1
  댓글 수: 2
Gn Gnk
Gn Gnk 2020년 12월 9일
Its cell contains 38x38 matrix . So its a 2D toeplitz. Not 1D.
Stephan
Stephan 2020년 12월 9일
편집: Stephan 2020년 12월 9일
In my example I used 2x2 matrices to keep it simple and short. Don't you think this can be extended to 38x38?
G{1}
G{2}

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


Roee Ronkin
Roee Ronkin 2023년 4월 19일
cell2mat(G(toeplitz(1:numel(G))))

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by