Out of Memory Error: How can one get around this?
조회 수: 6 (최근 30일)
이전 댓글 표시
Hi,
So I ran my code and in one of the lines it said I had no memory left. The actions on the line consisted of multiplying two matrices, one is 65000+ x 3 in dimension and the other is the transpose of the first. I would assume this data is too large to compute. Is there any possible way of getting around this?
I was thinking about using functions such as fopen, fread, textscan after looking in the documentation. Would this solve my problem? Any help would be greatly appreciated.
Thanks, Ian
댓글 수: 0
채택된 답변
Oleg Komarov
2011년 5월 30일
beta = X\y
From the reference below an example (fit y = b_1 + b_2*t + b_3*t^2 + b_4*t^3):
t = [1900;1910; 1900; 1930; 1940; 1950; 1960; 1970; 1980; 1990];
y = [75.9;91.9;105.7;123.2;131.6;150.6;179.3;203.2;226.5;249.6];
% Build X
X = bsxfun(@power,t,0:3);
b = X\y;
댓글 수: 10
Oleg Komarov
2011년 6월 3일
I remember you posted smt but then deleted, it could be from what i remember
추가 답변 (4개)
Walter Roberson
2011년 5월 30일
Is that multiplication
(3 x 65000) * (65000 x 3)
thus returning a 3 x 3 final matrix?
Or is it
(65000 x 3) * (3 * 65000)
thus returning a 65000 x 65000 final matrix?
If you are expecting a 65000 x 65000 output, then where did you intend to store that array? If the elements were double precision, that would be a 31 1/2 GB matrix.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!