Re: Matlab -> Fortran
- From: "Beliavsky" <beliavsky@xxxxxxx>
- Date: 27 Feb 2007 15:30:10 -0800
On Feb 27, 5:55 pm, Gib Bogle <g.bo...@xxxxxxxxxxxxxxxxxxxxxx> wrote:
Is there a program to convert Matlab code to Fortran?
Thanks
Gib
Yes, there is matlab2fmex https://sourceforge.net/projects/matlab2fmex/
.. I think it requires Matlab to run.
Your question is asked occasionally on comp.soft-sys.matlab, where
NZTideman wrote as follows:
"I've transferred a lot of Fortran programs to Matlab (and also the
reverse).
The best way I've found is to do it by hand, translating line by line
in an editor, changing "do" to "for" and "end do" to "end", etc.
If your Fortran is 90/95, it's pretty easy because the vector
operations translate directly, but if you have Fortran IV, with
goto's
and computed goto's, then it's very difficult to do it by hand. I've
usually found that in that case, it's better to start over in Matlab."
If you go the manual route you may find useful the "language tables"
of John Akin at
http://www.owlnet.rice.edu/%7Emech517/F90_docs/tables.pdf
which shows the equivalent constructs in C++ Fortran 90, Fortran 77,
and Matlab.
.
- Follow-Ups:
- Re: Matlab -> Fortran
- From: ben
- Re: Matlab -> Fortran
- References:
- Matlab -> Fortran
- From: Gib Bogle
- Matlab -> Fortran
- Prev by Date: Re: suggestion for new intrinsic function: CONFORM
- Next by Date: Re: suggestion for new intrinsic function: CONFORM
- Previous by thread: Re: Matlab -> Fortran
- Next by thread: Re: Matlab -> Fortran
- Index(es):
Relevant Pages
|