Additional Information

Files and Directories — UNIX® Operating Systems

This section describes the directory organization and purpose of the files associated with the MATLAB® C and Fortran API on UNIX®[1] systems.

Figure: Directories where MATLAB C and Fortran API files are located on UNIX systems

matlabroot/bin

The matlabroot/bin directory contains two files that are relevant for the MATLAB API:

mex

UNIX shell script that creates binary MEX-files from C or Fortran MEX-file source code.

matlab

UNIX shell script that initializes your environment and then invokes the MATLAB interpreter.

This directory also contains the preconfigured options files that the mex script uses with particular compilers. See Preconfigured Options Files for more information.

matlabroot/bin/$ARCH

The matlabroot/bin/$ARCH directory contains libraries, where $ARCH specifies a particular UNIX platform. On some UNIX platforms, this directory contains two versions of this library. Library file names ending with .so or .dylib are shared libraries.

matlabroot/extern/include

The matlabroot/extern/include directory contains the header files for developing C and C++ applications that interface with MATLAB.

The relevant header files for the MATLAB API are:

engine.h

Header file for MATLAB engine programs. Contains function prototypes for engine routines.

mat.h

Header file for programs accessing MAT-files. Contains function prototypes for mat routines.

matrix.h

Header file containing a definition of the mxArray structure and function prototypes for matrix access routines.

mex.h

Header file for building MEX-files. Contains function prototypes for mex routines.

matlabroot/extern/src

The matlabroot/extern/src directory contains those C source files that are necessary to support certain MEX-file features such as argument checking and versioning.

Files and Directories — Microsoft® Windows® Operating Systems

This section describes the directory organization and purpose of the files associated with the MATLAB C and Fortran API on Microsoft® Windows® systems.

The following figure illustrates the directories in which the MATLAB API files are located. In the illustration, matlabroot symbolizes the top-level directory where MATLAB is installed on your system.

Figure: Directories where MATLAB C and Fortran API files are located on Windows systems

matlabroot\bin

The matlabroot\bin directory contains the mex.bat batch file that builds C and Fortran files into binary MEX-files. Also, this directory contains mex.pl, which is a Perl script used by mex.bat.

matlabroot\bin\win32\mexopts or matlabroot\bin\win64\mexopts

The matlabroot\bin\win32\mexopts or matlabroot\bin\win64\mexopts directory contains the preconfigured options files that the mex script uses with particular compilers. See Preconfigured Options Files for more information.

matlabroot\extern\include

The matlabroot\extern\include directory contains the header files for developing C and C++ applications that interface with MATLAB.

The relevant header files for the MATLAB API (MEX-files, engine, and MAT-files) are

engine.h

Header file for MATLAB engine programs. Contains function prototypes for engine routines.

mat.h

Header file for programs accessing MAT-files. Contains function prototypes for mat routines.

matrix.h

Header file containing a definition of the mxArray structure and function prototypes for matrix access routines.

mex.h

Header file for building MEX-files. Contains function prototypes for mex routines.

*.def

Files used by Microsoft® Visual C++® and Microsoft Fortran compilers.

mexversion.rc

Resource file for inserting versioning information into MEX-files.

matlabroot\extern\src

The matlabroot\extern\src directory contains files that are used for debugging MEX-files.

MEX Reference Examples

The mex subdirectory of /extern/examples directory contains MEX-file examples. It includes the examples described in the online MATLAB C and Fortran API Reference for MEX-Files (the functions beginning with the mex prefix).

MX Examples

The mx subdirectory of extern/examples contains examples for using the array access functions. Although you can use these functions in stand-alone programs, most of these are MEX-file examples. The exception is mxSetAllocFcns.c, since this function is available only to stand-alone programs.

Engine and MAT Examples

The eng_mat subdirectory in the extern/examples directory contains the MEX-file examples (C and Fortran) for using the MATLAB engine facility, as well as examples for reading and writing MATLAB data files (MAT-files). These examples are all stand-alone programs.

Technical Support

The MathWorks provides additional Technical Support through its Web site. A few of the services provided are as follows:

This knowledge base on our Web site includes thousands of solutions and links to Technical Notes and is updated several times each week.

http://www.mathworks.com/support/

Technical notes are written by our Technical Support staff to address commonly asked questions.

http://www.mathworks.com/support/tech-notes/list_all.shtml

[1] UNIX is a registered trademark of The Open Group in the United States and other countries.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS