MATLAB Answers

Kronecker product of cell array elemnts

조회 수: 11(최근 30일)
MohammadHossein Salimi
다시 열림: Walter Roberson 22 Dec 2018
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.

  댓글 수: 0

로그인 to comment.


SK 18 Aug 2018
>> 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 19 Aug 2018
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.

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.

Translated by