FORTRAN code in MATLAB
古いコメントを表示
I need to integrate a FORTRAN code into MATLAB. Which of the following options is more reliable, efficient (performance-wise), etc. to carry out this task?
1. Create a program in MATLAB that calls the FORTRAN program through the mex functions.
2. completely translate/convert the FORTRAN code into MATLAB code using the f2matlab function (or some other converter)
Thanks in advance!
4 件のコメント
James Tursa
2011 年 12 月 7 日
Does your Fortran code take inputs from the user and produce outputs (i.e., like a function)? Does your Fortran code write to the screen? Is it interactive with the user while it is running? Normally I would suggest (1) above, but that may depend on your answers to my questions.
Sumit Pal
2015 年 8 月 26 日
Yes it does. I need solution. Please help me.
Walter Roberson
2015 年 8 月 26 日
Sumit: which of those is true for your code? Is it like a function? Or is it interactive with the user?
Sumit Pal
2015 年 8 月 27 日
It is interactive with the user. How can I proceed?
採用された回答
その他の回答 (1 件)
Dr. Seis
2011 年 12 月 7 日
0 投票
In my experience, Matlab will most likely be slower than its Fortran equivalent. Instead of trying to manipulate the original Fortran code so that it is able to run as a MEX file, which I did and was a real pain in the rear, you might try having your Matlab program simply execute the Fortran code outside of Matlab (if your system has > 1 cpu) and then just have your Matlab program set up to wait for the program to finish.
I can elaborate a little more if this sounds like a possible 3rd alternative. What type of system are you running on?
2 件のコメント
michaelborg
2011 年 12 月 7 日
roborrr
2023 年 9 月 13 日
What commands can be used to rewrite the value of the temporary file temp001.txt "0" to "1" in Fortran?
カテゴリ
ヘルプ センター および File Exchange で Fortran with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!