Why are my sparse matrices converted to full matrices by 'lsqlin'?

조회 수: 1 (최근 30일)
I have some large sparse matrices (300000x100000) that I am attempting to pass to 'lsqlin'.
However, I receive the following errors:
Warning: Cannot use sparse matrices with active-set algorithm: converting to full.
> In lsqlin (line 368)
In example (line 5)
Error using full
Requested 261097x81168 (157.9GB) 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.
Error in lsqlin (line 377)
x     qpsub(full(C),d,[full(Aeq);full(A)],[beq;b],lb,ub,X0,neqcstr, ...
Here is my code:
options = optimoptions('lsqlin', 'Display', 'iter-detailed');
x = lsqlin(A,b,[],[],C,zeros(size(C,1),1),[],[],x0,options);
Here are my variables:
>> whos
Name Size Bytes Class Attributes
A 261097x81168 13254408 double sparse
C 76x81168 650568 double sparse
b 261097x1 14496 double sparse
x0 81168x1 262928 double sparse

채택된 답변

MathWorks Support Team
MathWorks Support Team 2017년 12월 20일
Better support for sparse matrices was added in R2017a for 'lsqlin'. Please upgrade to that version to avoid this issue.

추가 답변 (0개)

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by