out of memory

조회 수: 1 (최근 30일)
Pan
Pan 2012년 2월 13일
clear all
mov = aviread('book.avi');
xy=zeros([size(mov(1).cdata),length(mov)], 'uint8');
for ii=1:537
figure(10)
ii
xy(:,:,:,ii)=mov(ii).cdata;
imshow(xy(:,:,:,ii));
endwhen I read the code,these message also show again.
pleas teach me how to do
thank!
??? Error using ==> zeros
Out of memory. Type HELP MEMORY for your options.
Error in ==> framebook at 3 xy=zeros([size(mov(1).cdata),length(mov)], 'uint8');

채택된 답변

Walter Roberson
Walter Roberson 2012년 2월 13일
I did warn you in your previous thread on this topic to expect to run out of memory. No matter how much memory you have, there will be a movie bigger than that.
Are you certain that you need to store the data as a 4D array, and cannot process it in the mov struct instead?
Anyhow:
numframe = 537;
ii = 1;
thisframe = aviread('book.avi', ii);
xy = repmat(thisframe.cdata, [1, 1, 1, numframe]);
figure(10);
ii
imshow(thisframe.cdata);
drawnow();
for ii = 2 : numframe
thisframe = aviread('book.avi', ii);
xy(:,:,:,ii) = thisframe.cdata;
ii
imshow(thisframe.cdata);
drawnow();
end
Please expect this to be notably slower than your previous code. As usual, fast operations depend upon having a lot of memory, which you do not have.
  댓글 수: 1
Pan
Pan 2012년 2월 14일
Thank for your proposition!!

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

추가 답변 (1개)

Sean de Wolski
Sean de Wolski 2012년 2월 13일
you're trying to create an array the size of
[size(mov(1).cdata),length(mov)]
i.e.
prod([size(mov(1).cdata),length(mov)])
many elements.
How much RAM do you have? Are you on a 64bit system (capable of having more than 3gb of memory)?
  댓글 수: 3
Pan
Pan 2012년 2월 14일
32 bit system
Sean de Wolski
Sean de Wolski 2012년 2월 14일
Then you limit is somewhere around 3Gb.

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

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by