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 件のコメント

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 件)

カテゴリ

タグ

質問済み:

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