필터 지우기
필터 지우기

How to read large data file in Matlab?

조회 수: 12 (최근 30일)
Umair Nadeem
Umair Nadeem 2013년 11월 14일
댓글: Walter Roberson 2022년 2월 6일
I have a GPS signal data values stored in a .dat file of 200 GB. The data is in the form of uint8. I want to read 16 GB of data from the start and downsample it by a factor of 10 before storing the new signal in a separate file. I have used fread but I cam unable to read large data file. Is there any other way which I can use to read data in chunks and put them together afterwards? Anyone please help me out. Its very important that I read this data.
The specifications of software, platform & PC are:
Matlab R2012a. Windows 8 64-bit, Core i5 3rd Gen., 4 GB RAM, 500 GB of hard Disk Space

채택된 답변

Simon
Simon 2013년 11월 14일
Hi!
Is it a binary file or a normal text file? For text files you may use "fopen" and "fgetl" to read line by line. If you know your row format you may use "fscanf" to read a given number of values. Repeated calls to "fscanf" will read your whole file.
Can you give some (!) example lines? It is easier to help.
  댓글 수: 4
Sania Zahan
Sania Zahan 2022년 2월 6일
Hi My data shape is (39412, 3, 300, 25, 2), its numpy file with just numbers. Therefore above method changes the shape. I need to maintain the last 4 indexes. could you please suggest how may I do that. Thanks
Walter Roberson
Walter Roberson 2022년 2월 6일
A = fread(fid, [39412, 3, 300, 25, 2]);
However, you really need to test first, as it would be common to find the first two dimensions transposed between different programming languages. You might need to use
A = permute(fread(fid, [3, 39412, 300, 25, 2]), [2 1 3 4 5]);

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

추가 답변 (1개)

Sheikh Alsheikh
Sheikh Alsheikh 2018년 7월 26일
Same problem I had o face! I first break the data into chunks
  댓글 수: 1
Hammad Intersoft
Hammad Intersoft 2021년 5월 26일
how to open a large file by breaking it into chunks. i am facing a problem while opening a large file that has a size of 48*42*2414 and bytes 4866624. when i load this file in matla it says "cannot display summaries of variables with more than 524288 elements."

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

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by