필터 지우기
필터 지우기

Error using ==> mrdivide Out of memory

조회 수: 1 (최근 30일)
Fadzli
Fadzli 2017년 2월 7일
댓글: Fadzli 2017년 2월 8일
Hi, this is my code;
r=10
for i=1:r
Cs=1.17
Cc=2.37
v=0.0000711
kg=0.0457
kp=0.26
Ct=2.18
Kn=0.1
Cm=1.14
T=temperature(i,:);
Vtx=(((2*Cs*Cc*v)*((kg/kp)+(Ct*Kn)))/((1+(3*Cm*Kn))...
*(1+2*(kg/kp)+(2*Ct*Kn))))*(1/T)*(Delta_temperature/Delta_x);
end
Then, there is an error comes out;
??? Error using ==> mrdivide Out of memory. Type HELP MEMORY for your options.
Error in ==> Vtx=(((2*Cs*Cc*v)*((kg/kp)+(Ct*Kn)))/((1+(3*Cm*Kn))...
What is actually happen?
p/s: Delta_temperature & Delta_x already defined...

채택된 답변

Walter Roberson
Walter Roberson 2017년 2월 7일
You have
T=temperature(i,:);
Vtx=(((2*Cs*Cc*v)*((kg/kp)+(Ct*Kn)))/((1+(3*Cm*Kn))...
*(1+2*(kg/kp)+(2*Ct*Kn))))*(1/T)*(Delta_temperature/Delta_x);
T is a column vector, so 1/T is a request to do a Matrix Right Division. That takes more memory than a plain division -- it would require at least one matrix length(T) by length(T) to build the vandermode matrix, and then some other working memory (quite possibly another matrix the same size as that.)
Perhaps you want 1./T instead of 1/T ?
  댓글 수: 1
Fadzli
Fadzli 2017년 2월 8일
Thank you sir, I think I got the point...

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

추가 답변 (1개)

Jan
Jan 2017년 2월 7일
편집: Jan 2017년 2월 7일
The dimensions of the already defined variables Delta_temperature and Delta_x matter. If they are [N, 1] and [M, 1] vectors, the result is a [N, M] matrix. It seems like the creation of this matrix exhaust your memory.
There are several methods to cope with this problem:
  1. Install more RAM
  2. Consider if this is a bug and you want an elementwise division with the ./ operator.
  3. Install more RAM
  4. Close other applications
  5. Use single precision, if applicabale and accurate enough for the problem
  6. Install more RAM and care for using a 64 bit Matlab, such that the RAM can be used
  7. Clear unused variables. Most of all compute large arrays outside the loop and once only
  8. Check the sizes of the concerned variables - perhaps there is a bug before
  9. And, you can guess it, install more RAM ;-)
  댓글 수: 1
Fadzli
Fadzli 2017년 2월 8일
Thank you sir, I think I got the point...

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

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by