
8 External Interfaces
Programming Interfaces
In this section.. .
“Call MATLAB from C and Fortran Programs” on page 8-2
“Call C and Fortran Programs from MATLAB” on page 8-2
“Call Java from MATLAB” on page 8-3
“Call Functions in Shared Libraries” on page 8-3
“Import and E xport Data” on page 8-3
Call MATLAB from C and Fortran Programs
Use the M ATLAB engine library to call M ATLAB from C and Fortran
programs. When you call MATLAB from your own programs, MATLAB acts
as a computation engine. For ex ample, you can:
• Use MATLAB as a programmable mathematical subroutine library.
• Build an application with a front end(GUI)programmedinCandaback
end (analysis) programmed in MATLAB.
Call C and Fortran Programs from MATLAB
Use MEX-files to call your own C or Fortran subroutines from MATLAB as if
they were built-in functions. For example, you can:
• Call preexisting C and Fortran programs from MATLAB without having
to rewrite t hem as M-files.
• Code bottleneck computations that d o not run fas t enough in MATLAB in
CorFortranforefficiency.
The mxArray a ccess library creates and manipulates MATLAB arrays. The
mex library performs operations in the MATLAB environment.
8-2
Kommentare zu diesen Handbüchern