-1. SUPPORT f2matlab AND CONSULTING
3. BUG REPORTS and WISH LIST
4. F2MATLAB CAPABILITIES
5. F2MATLAB LIMITATIONS
6. HOW TO USE F2MATLAB
8. REVISION HISTORY
I now also do conversion/translation/validation/optimization consulting.
Please refer to my webpage:
Even though f2matlab is free (under GPL) for the using, I would like
to ask that those who find it useful, wish to support the project,
and are able to make a contribution to please do so commesurate with
use (especially corporations). *** Important - Please donate using
your PayPal account and not a credit card so as to avoid fees at
PayPal. Thank you! PayPal email ID: email@example.com
0. DISCLAIMER: Matlab is a trademark of the Mathworks company and is
owned by them. The author makes no guarantee express or implied of
any kind as to the applicability, usefulness, efficacy,
bug-freeness, or the accuracy of the ensuing results from using
The author bears no responsibility for any unwanted effect
resulting from the use of this program. The author is not
affiliated with the Mathworks. The source code is given in full in
the hopes that it will prove useful.
1. OBJECTIVE: f2matlab.m is a small translator which aims to
convert Fortran90 files to Matlab m-files.
1) Matlab is becoming ubiquitous in the engineering and scientific
communities for its ease of use coupled with its powerful
libraries. Yet the fact remains that a large number of stable and
dependable programs exist in the fortran77/90 corpus.
2) Many times, often amidst the porting of fortran programs to
Matlab, an automated converter of fortran90 code to Matlab code would
3) Having written matlab2fmex.m, a matlab to fortran90 mex file
converter, the writing of f2matlab, which performs the reverse
conversion, was substantially simplified.
3. BUG REPORTS and WISH LIST:
For all bug reports, a wish list for f2matlab, and suggestions,
or email firstname.lastname@example.org
4. F2MATLAB CAPABILITIES: f2matlab is aimed at converting
Fortran90 code to Matlab m-files. Accordingly, only basic data types
and constructions are recommended. f2matlab can handle:
all numeric types (handled by Matlab interpreter)
most string functions
comparisons, branches, loops, etc.
basic read/write/print statements (if it's not too fancy...)
5. F2MATLAB LIMITATIONS: f2matlab can not handle some features of
fortran90 yet. These include:
can't handle complex read and write statements
6. HOW TO USE F2MATLAB: f2matlab expects a single fortran90 fortran file to
convert. If you have fortran77 code, use some free converter
(e.g. to_f90 by Alan Miller) before running f2matlab. Then simply
call f2matlab by using the full filename:
The output will be filename.m in the same directory.
A few flags are available that effect conversion:
% want_kb=0; 1 ==> if keyboard mode is desired after some conversion steps
% want_ze=0; 1 ==> direct f2matlab to zero all array variables.
% want_fi=0; 1 ==> direct f2matlab to try to put fix()'s around declared integers.
Multiple subroutines and functions can and should be in the same fortran90 file.
Ben Barrowes (2023). benbarrowes/f2matlab (https://github.com/benbarrowes/f2matlab), GitHub. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Versions that use the GitHub default branch cannot be downloaded
Changed description to match new Dartmouth website
Added link to most recent version off site.
Several bug fixes and enhancements. Include files, types, etc.
bug fixes, features added, more robust
Some documentation updates and bug fixes.
Many bug fixes and major upgrade of capabilities.