Increasing speed to perform binary read/write operations
Show older comments
Hello everyone. I have a big binary file with a ascii header. In binary part I have a data which I need to change, smooth etc. Read part is looks like:
fid1=fopen(path,'rb','l');
for ii=1:ramp
skbytes=begbytes+skip+(ii-1)*skip+(ix-1)*nx*ncol+(iy-1)*nx;
fseek(fid1,skbytes,'bof');
ax=fread(fid1,[1 1],sh);
aax=double(ax);
yiv(ii,1)=aax;
end
fclose(fid1);
The writing part is the next:
fid=fopen(path1,'r+','l');
for kk=1:ramp
skbytes=begbytes+skip+(ix-1)*ncol*nx+(iy-1)*nx+(kk-1)*skip;
fseek(fid,skbytes,'bof');
fwrite(fid,smy(kk,1),sh);
end
clear kk;
fclose(fid);
The problem is I have 128x128 numbers of these curves. And it is required 3 hours to perform all calculations.
I will be thankful for any idea or help with this.
1 Comment
Dima Lotnik
on 20 Nov 2014
Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!