I've been trying to open/read ASCII files which are not so big: about 15Mb; and I get the message "not enough memory to open the file" or something like that. According to the "memory" command, I've got plenty of available memory :
  • Maximum possible array: 13020 MB (1.365e+10 bytes) *
  • Memory available for all arrays: 13020 MB (1.365e+10 bytes) *
  • Memory used by MATLAB: 708 MB (7.420e+08 bytes)
  • Physical Memory (RAM): 8073 MB (8.465e+09 bytes)
What's going on ?

댓글 수: 4

dpb
dpb 2014년 2월 6일
It's possible while there's lots of memory there's not enough contiguous memory--I don't know that the memory command can tell that for certain.
Show your work -- how are you attempting to read the file?
Frederic
Frederic 2014년 2월 6일
편집: Frederic 2014년 2월 6일
Well, I tried with the "load" command (the files are basically ASCII matrices with not headers). It does not work. Then I tried with a "fscanf" but the even "fopen" command gives me the same result: not enough memory...
dpb
dpb 2014년 2월 6일
Again, show your work...actual code/error messages in context are far more informative than descriptions paraphrased...
Have you done a
clear all
and similar first?
Have you tried to load or read a subset? Are you sure there are record markers in the file or is it perhaps malformed as a single, long record of 15+MB or some other problem inherent in it/them?
And, of course, if you can control the creation of these files, for such sizes using stream unformatted is much faster and more disk efficient than formatted.
Walter Roberson
Walter Roberson 2014년 2월 6일
To check, your fopen() statement itself is triggering the memory error? And you have no accidentally defined "fopen" as an array and have not accidentally provided your own fopen.m file ?

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Standard File Formats에 대해 자세히 알아보기

태그

질문:

2014년 2월 6일

댓글:

2014년 2월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by