Extracting data from large file
11 次查看(过去 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!