Kronecker product of cell array elemnts

2 次查看(过去 30 天)
MohammadHossein Salimi
重新打开: Walter Roberson 2018-12-22
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
>> 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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by