Problem opening "large" file

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 个评论

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...
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.
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 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by