A PUZZLING QUESTION: Does Matlab's Mex file support external inputs and outputs?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, I would like to ask if Mex (Fortran) files are able to use Fortran's OPEN/CLOSE/WRITE/READ from files command?
If yes, how do I implement it in Matlab's Mex files? Else, are there any alternatives to output in an external document?
Thanks
Zhonghao
댓글 수: 0
답변 (1개)
James Tursa
2014년 6월 9일
Yes, you can use native Fortran file I/O in mex routines. Just write the code as you normally would. The main restriction is in screen I/O ... you can't READ(5,etc) or WRITE(6,etc) in a mex routine as the operations will not work properly. But file I/O is OK.
댓글 수: 5
James Tursa
2014년 6월 11일
편집: James Tursa
2014년 6월 11일
Yes, but what is the specific message you see on the screen? Anything? Does anything show up in the Test.txt file?
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!