Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 460 Bytes

mexExample.md

File metadata and controls

13 lines (8 loc) · 460 Bytes

Example of mex (Matlab C integration)

mex allows a function written in C to be called from a matlab m-file.

An example is in src/doOdeSingle.m. This calls a function mxOdeDefn(). The function mxOdeDefn() was created in the file mxOdeDefn.c.

To execute the example:

  • In Matlab, run mex mxOdeDefn.c. This will create a file called mxOdeDefn.mexXXXX where "XXXX" depends on your local cpu architecture.
  • In Matlab, run doOdeSingle.m.