Question

I need to use a function in Matlab that is defined by a dll file. I got an example that guy converted a dll to mexw32 file but i have known how I do this. I tried use loadlibrary but it didn't create any file. How I can do this?

Was it helpful?

Solution

loadlibrary is MATLAB's implementation of FFI services, a mechanism of calling functions in external shared libraries. It involves converting between C-types and their equivalent MATLAB data types to pass data around.

MEX-files are also a kind of dynamically linked libraries (with .mex* extension), that can be run directly in MATLAB as a regular function without any special syntax.

The difference is that it has a specific gateway routine called mexFunction, which receives both input and output as mxArray type. mxArray is an opaque type defined in mex.h header file, which is the fundamental type underlying all MATLAB data. You usually manipulate this data using functions in the MEX library API.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top