F90_CALLS_MATLAB
FORTRAN90 Programs Interacting with MATLAB


F90_CALLS_MATLAB is a FORTRAN90 program which can interact with MATLAB.

In these examples, the interaction is done through the SYSTEM command, which allows a FORTRAN90 program to issue a command to the operating system, and to receive a result flag indicating the successful completion or failure of that command.

The SYSTEM command is not a standard or intrinsic routine defined by the FORTRAN standard. However, it is often available to FORTRAN programmers on UNIX systems. In particular, the GNU GFORTRAN and IBM XLF compilers include this routine.

Data can be passed between MATLAB and FORTRAN using text files.

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages:

F90_CALLS_MATLAB is available in a FORTRAN90 version.

Related Data and Programs:

C_CALLS_F90, C programs which illustrate a C program calling a FORTRAN90 subroutine.

C++_CALLS_F90, C++ programs which illustrate how a C++ main program can call a FORTRAN90 subroutine.

F90_CALLS_C, FORTRAN90 programs which illustrates how a FORTRAN90 program can call a C function.

F90_CALLS_C++, FORTRAN90 programs which illustrates how a FORTRAN90 program can call a C++ function.

MATLAB_CALLS_C, MATLAB programs which illustrate how C functions can be written, compiled, and called from MATLAB using the MEX facility;

MATLAB_CALLS_F77, MATLAB programs which illustrate how FORTRAN77 functions can be written, compiled, and called from MATLAB using MATLAB's mex facility;

MATLAB_CALLS_F90, MATLAB programs which call a FORTRAN90 function using MATLAB's mex compiler;

Reference:

  1. Duane Hanselman, Bruce Littlefield,
    Mastering MATLAB 7,
    Pearson Prentice Hall, 2005,
    ISBN: 0-13-143018-1.
  2. The Mathworks,
    Using MATLAB, Version 6,
    The Mathworks, 2002.

Examples and Tests:

MATRIX_MULTIPLY shows how a FORTRAN90 program can cooperate with MATLAB. The FORTRAN90 program generates two matrices A and B, writes them to files, and invokes MATLAB with a particular M-file. The M-file reads the matrices from the files, computes the product C and writes it to a file. The FORTRAN90 program resumes execution, reading the C file and reporting the result.

You can go up one level to the FORTRAN90 source codes.


Last revised on 02 November 2007.