| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
| On this page… |
|---|
Call MATLAB Software from C and Fortran Programs Call C and Fortran Programs from MATLAB Command Line Call Sun Java Commands from MATLAB Command Line |
Use the MATLAB engine library to call MATLAB from C and Fortran programs. When you call MATLAB from your own programs, MATLAB acts as a computation engine. For example, you can:
Use MATLAB as a programmable mathematical subroutine library.
Build an application with a front end (GUI) programmed in C and a back end (analysis) programmed in MATLAB.
Use MEX-files to call your own C or Fortran subroutines from the MATLAB command line as if they were built-in functions. For example, you can:
Call preexisting C and Fortran programs from MATLAB without having to rewrite them as M-files.
Code bottleneck computations that do not run fast enough in MATLAB in C or Fortran for efficiency.
The mxArray access library creates and manipulates MATLAB arrays. The mex library performs operations in the MATLAB environment.
Every installation of MATLAB software includes Java Virtual Machine (JVM™) software. The JVM software allows you to use the MATLAB interpreter with Java commands and to create and access Java objects. For example, you can:
Access Java API class packages that support I/O and networking.
Access third-party Java classes.
Construct Java objects in MATLAB.
Call Java methods, using either Java or MATLAB syntax.
Pass data between MATLAB variables and Java objects.
Use the MATLAB interface to generic DLLs to interact with functions in a dynamic link library (.dll) on Microsoft Windows platforms, a shared object file (.so) on The Open Group UNIX and Linus Tovald's Linux® platforms, or a dynamic shared library (.dylib) on Apple Macintosh platforms based on Intel® technology.
MATLAB supports any shared library written in C, or in any language that can provide a C interface.
MAT-files and the MAT-file access library provide a convenient mechanism for moving MATLAB binary data between platforms, and for importing and exporting data to stand-alone MATLAB applications.
![]() | External Interfaces | Interface to .NET Framework | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |