MEX Functions and Files
Ben Trumbore, Brandon Barker, Nate Woody (original)
Cornell Center for Advanced Computing
Revisions: 8/2025, 8/2023, 8/2020, 3/2011 (original)
This topic covers the basics of writing MEX functions that are written in other programming languages and which, after compiling, can be incorporated into your MATLAB programs. Several examples are provided and the APIs that allow you to code in different languages are discussed. The topic closes with an exercise that explores a more complicated MEX function.
Objectives
After you complete this topic, you should be able to:
- Describe the four standard parameters of a MEX function.
- Write and compile a simple MEX function.
- Run a compiled MEX function.
- Describe the various APIs that can be used to create MEX functions in different programming languages.
Prerequisites
Before reading this topic, you should:
- Complete the Introduction to MATLAB topic.
©
|
Cornell University
|
Center for Advanced Computing
|
Copyright Statement
|
Access Statement
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)