Extracting data from large file
조회 수: 9 (최근 30일)
이전 댓글 표시
Hi all,
I have been writing code to read data from a binary file. I have gotten to the stage now where I just need to reorganize the data, but I have a question about how to go about the organization.
The binary file contains 1310720 elements, comprising of 20, 256*128 images with real and imaginary data points. When loaded into MATLAB it is a row column vector. I know that the first 512 elements belong to image1, the second to image2...., then finally the twentieth to image twenty. Then the twenty first to image1 and so on.... My question is, how would I go about writing code for this extraction? I have tried writing some in a simple loop, but I haven't yet been able to come up with a way to make it anything but very laborious. Any help would be appreciated.
댓글 수: 0
채택된 답변
Walter Roberson
2016년 12월 22일
Guessing a bit about the format:
temp = reshape(TheVector, 512, 20, []);
images = permute( temp(1:256, :, :), [1 3 2]) + i * permute( temp(257:512, :, :), [1 3 2]);
and then the third dimension would be the image number.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!