Why are my sparse matrices converted to full matrices by 'lsqlin'?
1 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2017-12-20
回答: MathWorks Support Team
2017-12-20
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
2017-12-20
Better support for sparse matrices was added in R2017a for 'lsqlin'. Please upgrade to that version to avoid this issue.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Least Squares 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!