External Interfaces Previous page   Next Page

Passing Arguments

To determine which MATLAB data types to use when passing arguments to library functions, see the output of libfunctionsview or libfunctions -full. These functions list all of the functions found in a particular library along with a specification of the data types required for each argument.

A sample external library called shrlibsample is supplied with MATLAB. The .dll file for the shrlibsample library resides in the directory, extern\examples\shrlib. To use the shrlibsample library, you first need to either add this directory to your MATLAB path with the command,

or make this your current working directory with the command,

The following example loads the shrlibsample library and displays some of the functions that come with the library:

These functions are all written in C. What you see here is the MATLAB syntax for calling the C functions.

Some General Rules

There are a few interesting things to note about the input and output arguments shown in the function listing above:

A few general guidelines on passing arguments:


Previous page  Invoking Library Functions Passing References Next page

© 1994-2005 The MathWorks, Inc.