reading a large binary file in MATLAB

Hello,
I have to read in a large Binary file whose size is 92,504 KB. When I am using fread command MATLAB is giving me error
Error using fread Out of memory. Type HELP MEMORY for your options.
I tried to restart MATLAB also so that if I am using any virtual memory it should be cleared but still the problem persists.
How can I solve this problem of reading data.

댓글 수: 8

what does the MEMORY command show on your machine (type 'memory' at command prompt and post results...)
Try the long form
[UV,SV]=memory
and look specifically at
SV.PhysicalMemory.Available/1024/1024
Which version ML and OS?
Ricky
Ricky 2013년 7월 5일
If I type 'memory' I get the below results.
Maximum possible array: 861 MB (9.024e+08 bytes) *
Memory available for all arrays: 861 MB (9.024e+08 bytes) *
Memory used by MATLAB: 391 MB (4.103e+08 bytes)
Physical Memory (RAM): 1910 MB (2.003e+09 bytes)
  • Limited by System Memory (physical + swap file) available.Physical Memory (RAM): 1910 MB (2.003e+09 bytes)
  • Limited by System Memory (physical + swap file) available.
and If I run 'SV.PhysicalMemory.Available/1024/1024' at command prompt I get the below result
ans =
203.4063
Ricky
Ricky 2013년 7월 5일
please help it is very urgent.
what does your fread statement look like?
I've been reading 50 MB files with:
in=fopen(fname,'r');
x=fread(in,inf,'*double', 0, 'b');
I've found out of memory can sometimes be misleading.
Joe
Ricky
Ricky 2013년 7월 5일
below is the code I am using for reading my binary file
fid = fopen('dump_20_master.dump','r');
[data,count] = fread(fid,'uint8');
Ricky
Ricky 2013년 7월 5일
I am sorry for using the word urgent .

답변 (1개)

Walter Roberson
Walter Roberson 2013년 7월 5일

0 개 추천

fread(fid,'uint8') reads uint8 data and converts it to double. You should leave it as uint8 using fread(fid,'*uint8')

이 질문은 마감되었습니다.

질문:

2013년 7월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by