Increasing speed to perform binary read/write operations
이전 댓글 표시
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.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!