Kronecker product of cell array elemnts

Hi, I have a cell array C=cell(3,20).I want the kronecker product of each element to all the others.How can I do that?!! Thanks in advance.

답변 (1개)

SK
SK 2018년 8월 18일

0 개 추천

>> CL = repmat(transpose(C(:)), [3*20, 1]);
>> CR = repmat(C(:), [1, 3*20]);
>> P = cellfun(@kron, CL, CR, 'UniformOutput', false);
This gives a 60 x 60 cell array of matrices.

댓글 수: 1

SK
SK 2018년 8월 19일
I'm sorry I don't understand your question. The code gives kron(C{i,j}, C{k,l}), for all possible pairs including for i = j = k = l.

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

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2018년 8월 18일

다시 열림:

2018년 12월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by