フィルターのクリア

Out of memory - opening a big file

1 回表示 (過去 30 日間)
Francesco
Francesco 2011 年 10 月 19 日
I have to open a very big file (220mega) and i used "textscan", but after a few minutes it returns "Out of memory. Type HELP MEMORY for your options.
Is it possibile to solve this memory problem?
Thanks in advance.

回答 (2 件)

Nirmal Gunaseelan
Nirmal Gunaseelan 2011 年 10 月 19 日
The tech note provides some general guidelines for handling out of memory errors.
In your case, I'd suggest reading data in pieces. For example,
C = textscan(fid, 'format', N)
can be run many times with the same FID and all the C's can be eventually combined. Some examples are the TEXTSCAN doc.

Walter Roberson
Walter Roberson 2011 年 10 月 19 日
220 megabytes is not very much, and should only cause a problem if you are representing the data in larger datatype than it needs. For example, if you are reading a 1 or 2 digit number, then you would be better using a format specifier that instructs textscan to store as int8 or uint8. Reading a whole string of 10010101<etc> and telling textscan to store each character as a double precision number would use a lot of storage.

カテゴリ

Help Center および File ExchangeLarge Files and Big Data についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by