Can this binary reading FORTRAN function file be replicated in MATLAB?

5 views (last 30 days)
I am workin with old photon statistics data and need to interpret a number of .bin files to be used in MATLAB for analysis.
The loops are regogniseable and it looks like it should be able be converted but there are some phrases that I can't regognise.
The old FORTRAN fucntion is as follows
function lecroy_bin,file,n
n=long(n)
header=bytarr(359)
data=bytarr(n)
openu,u,file,/get_lun
readu,u,header
readu,u,data
free_lun,u
for i=long(0),long(n-1) do begin
if (data(i) lt 128) then begin
data(i)=data(i)+128
endif else begin
data(i)=data(i)-128
endelse
endfor
return,data
end

Answers (0)

Categories

Find more on Fortran with MATLAB in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!