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

조회 수: 9 (최근 30일)
Fraser Barnard
Fraser Barnard 2021년 3월 29일
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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Fortran with MATLAB에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by