Sparse knonecker product of large and several matrices

조회 수: 3 (최근 30일)
Fernando
Fernando 2014년 3월 26일
댓글: Fernando 2014년 3월 26일
Hi,
I'm trying to create a sparse kronecker product without actually generating the kron product and then generating the sparse matrix. Is there a way to do this? For example
E=eye(100);
I=ones(20);
K=sparse(kron(E,I));
Right now the code first generates the kron product and then keeps on the information of non-zero elements. As I need to do this lots of time because I need to generate and keep in memory different K matrices (K1, K2, ... K200, for E1,...E200, and I1,...I200), the generation of the kron product uses all my memory. Is there anyway I could go from the E's and I's to the K's without generating the full matrices?
Thanks,

채택된 답변

Matt J
Matt J 2014년 3월 26일
편집: Matt J 2014년 3월 26일
E=speye(100);
I=ones(20);
K=kron(E,I);
  댓글 수: 3
Fernando
Fernando 2014년 3월 26일
Thanks!
Fernando
Fernando 2014년 3월 26일
Thanks, I'll look at this.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by