Fortran code to MatLab converter (f2matlab)

Hey!
I'm trying to convert a Fortran code to MatLab that I found at the appendix of this article (https://quark.phy.bnl.gov/~creutz/mypubs/pub092.pdf). My question is similar to https://www.mathworks.com/matlabcentral/answers/46264-how-do-i-install-f2matlab, I use the function over the fortran code and it doesn't create a file.m at the same directory. I already read the README file and it says " The output will be filename.m in the same directory." but I still don't get my desirable output. I would like to know if someone uses this tool and can help me before I contact the code's author. I also accept suggestions of alternatives to converse get these code on MatLab.
Regards,
Miguel Cardoso

6 commentaires

Ben Barrowes
Ben Barrowes le 16 Avr 2019
What specific error comes up? What command did you try to use to convert your code?
Miguel Cardoso
Miguel Cardoso le 16 Avr 2019
I'm only using f2matlab('filename.f90') and I'm getting
Index exceeds the number of array elements (0).
Error in wordconverter_f (line 1009)
funstr{i}=[funstr{i}(1:parens(1)),subscripts{1},funstr{i}(parens(2):end)];
Error in f2matlab (line 3909)
[funstr,fortranfunwords,tempflag,temp2,temp4,needThings]=wordconverter_f(i,j,funstr,funstrnumbers,funstrnumbers_b,funstrnumbers_e,funstrwords,funstrwords_b,funstrwords_e,fs_good,funwords,fortranfunwords,formats,localVar,modLocalVar,MLapp,varp,want_row,var_words,this_fun_name,TFops,allTypeDefs,funwordsML,statementFunction,fun_name,dumvar,want_gl,fundecline,funargs,needThings,usedMods);
Ben Barrowes
Ben Barrowes le 2 Mar 2021
Looks like there is some fortran function that should have some imput arguments, but for some reason does not.
Please mail me the fortran code and I can take a look: barrowes@alum.mit.edu
Chao Liu
Chao Liu le 18 Déc 2021
Hi I'm having the exact same problem. I wonder if this problem can be fixed?
Ben Barrowes
Ben Barrowes le 19 Déc 2021
Please email me and I can take a look.
Hello, I also have the same problem. I wonder if you can help me to solve it. Thank you.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Fortran with MATLAB dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by