调用matlab compiler编译出来的函数

All programs that call MATLAB Compiler generated shared libraries have roughly the same structure:

  1. Declare variables and process/validate input arguments.

  2. Call mclInitializeApplication , and test for success. This function sets up the global MCR state and enables the construction of MCR instances.

  3. Call, once for each library, <libraryname>Initialize , to create the MCR instance required by the library.

  4. Invoke functions in the library , and process the results. (This is the main body of the program.)

  5. Call, once for each library, <libraryname>Terminate , to destroy the associated MCR.

  6. Call mclTerminateApplication to free resources associated with the global MCR state.

  7. Clean up variables, close files, etc., and exit.

To see these steps in an actual example, review the main program in this example, triangle.c .

m文件

 

void mlfSierpinski(int nargout, mxArray** x, mxArray** y,mxArray* iterations, mxArray* draw)

第一个参数是返回的参数个数,之后分别为返回参数,输入参数

triangle.c程序为:



展开阅读全文

没有更多推荐了,返回首页