unknown matlab error

Hi there, I deal with pretty large sparse arrays. There the following error occurred where I have no explanation for:
>> M = sparse(17e6,17e6);
>> m = M(2.82e14);
??? Maximum variable size allowed by the program is exceeded.
although "numel(M) = 2.89e14".
Can anyone please bring light into this error message?

댓글 수: 2

Lars Ludwig
Lars Ludwig 2012년 1월 19일
the matrix is already sparse, the crucial point is that I use linear indexing... that only allows 48 bit integers
I pinned this issue down in a second question
Andreas Goser
Andreas Goser 2012년 1월 19일
I understand. My answer was purposly generic to be helpful for people that search for this error message.

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

답변 (1개)

Andreas Goser
Andreas Goser 2012년 1월 19일

0 개 추천

You are attempting to create a matrix with more elements than the maximum number of elements allowed in MATLAB.
Common causes: MATLAB will attempt to create a matrix with a large number of elements, as long as that number of elements is less than the maximum number of elements allowed in a matrix. You can determine this maximum using the COMPUTER function in the following way.
[str, maxsize] = computer
Solution: If the matrix you are attempting to create has relatively few nonzero elements, you may be able to create it as a sparse matrix. You can use the SPARSE function and the other sparse matrix manipulation functions to create and manage this matrix. Type
help sparfun
for a list of the sparse matrix manipulation functions. Note, however, that the limitation on the maximum number of elements still exists; now it only applies to the nonzero elements of the sparse matrix. If your matrix is not sparse, however, you will need to break it into sections with a number of elements less than the maximum returned by the COMPUTER function.

카테고리

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

질문:

2012년 1월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by