Use reshape to isolate elements of kron product

조회 수: 2 (최근 30일)
marnovaes
marnovaes 2023년 11월 22일
편집: Matt J 2023년 11월 22일
The kron product works like this:
How can I reshape this into an array C such that ?
Or more generally if I have how do I get Z such that ?

채택된 답변

Matt J
Matt J 2023년 11월 22일
편집: Matt J 2023년 11월 22일
You can use blkReshape from this FEX download
Example:
B=ones(2);
A=[10 30;20 40];
C=kron(A,B)
C =
10 10 30 30
10 10 30 30
20 20 40 40
20 20 40 40
Cr=blkReshape(C,size(B), [ ones(1,ndims(B)), size(A)])
Cr(:,:,1,1) =
10 10
10 10
Cr(:,:,2,1) =
20 20
20 20
Cr(:,:,1,2) =
30 30
30 30
Cr(:,:,2,2) =
40 40
40 40

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by