필터 지우기
필터 지우기

Reading fortran unformatted binary file into matlab

조회 수: 1 (최근 30일)
ARF
ARF 2015년 3월 21일
답변: Image Analyst 2015년 3월 21일
I would like to read an unformatted binary file written with FORTRAN into MATLAB. The FORTRAN code I used to write the data in binary format is the following:
!!$!%%%%%%%%OUTPUT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
do k=1,nt
write(strn4,'(I4.4)')k
nameout1 = trim(directory)//'fileuv-U'//strn4//'.dat'
iunitout = 74
open(iunitout,file=nameout1,form='unformatted')
do j=1,ny
do i=1,nx
write(iunitout) u(i,j,k),v(i,j,k)
enddo
enddo
close(iunitout)
enddo
I would like to read the resulting binary file into MATLAB. Thank you very much for your help.

채택된 답변

Image Analyst
Image Analyst 2015년 3월 21일
Try fopen(), fread(), and fclose(). Examples are in the help.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by