필터 지우기
필터 지우기

Exceeding maximum array size with mldivide and sparse matrices?

조회 수: 6 (최근 30일)
Dan Gianotti
Dan Gianotti 2017년 3월 8일
댓글: Dan Gianotti 2017년 3월 14일
I have two (large) sparse matrices:
size(A) = [6262144 6262144]
size(B) = [6262144 864000]
I would like to calculate A \ B (and get a sparse matrix result), but get an error about exceeding maximum array size:
Requested 6262144x864000 (40311.3GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information.
Obviously this is a little silly since the array being created is the same size as B (which happily exists with no problem). I'm presuming that mldivide is converting some intermediate matrix to full along the way, understandably causing memory problems.
Is there a work-around for this?

답변 (1개)

Xiangbo Liang
Xiangbo Liang 2017년 3월 14일
I believe you can use MATLAB tall array instead to deal with the arrays that is too large and possibly exceed the memory limit.
For most of the operations, tall array works very similarly as the traditional arrays, you can find the detailed instructions on the documentation page below:
  댓글 수: 1
Dan Gianotti
Dan Gianotti 2017년 3월 14일
I'll try this, but it sounds like it won't make use of the MUCH more efficient methods used for matrix division when using sparse matrices (which seems important given the size of these matrices).
Is that right?

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by