Re: Matlab -> Fortran
- From: "ben" <laserbin@xxxxxxxxx>
- Date: 27 Feb 2007 17:52:59 -0800
On Feb 27, 6:30 pm, "Beliavsky" <beliav...@xxxxxxx> wrote:
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 matlab2fmexhttps://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 athttp://www.owlnet.rice.edu/%7Emech517/F90_docs/tables.pdf
which shows the equivalent constructs in C++ Fortran 90, Fortran 77,
and Matlab.
I also do-it-by-hand occationally, but always translate matlab to
fortran. When the numerical library is properly installed, it is not
very hard in most cases to translate from matlab to fortran.
There is an interesting project called Falcon (http://
www.csrd.uiuc.edu/falcon/falcon.html).
" It uses MATLAB as the source language and generates Fortran 90 plus
directives for parallelization, MATLAB, and pC++ as target
languages."
However, the page has not been updated since Feb 2, 1996. I could not
find the source code or binary online.
.
- Follow-Ups:
- Re: Matlab -> Fortran
- From: Beliavsky
- Re: Matlab -> Fortran
- References:
- Matlab -> Fortran
- From: Gib Bogle
- Re: Matlab -> Fortran
- From: Beliavsky
- Matlab -> Fortran
- Prev by Date: Re: array-valued function as dummy argument
- Next by Date: Re: Matlab -> Fortran
- Previous by thread: Re: Matlab -> Fortran
- Next by thread: Re: Matlab -> Fortran
- Index(es):
Relevant Pages
|