root/library/doc/tutorial/mexfiles.dox @ 659

Revision 659, 1.2 kB (checked in by mido, 15 years ago)

synchronization of documentation pages names

Line 
1/*!
2\page mexfiles How to write and use mex files for Matlab
3
4\section use Howto use predefined mexfiles
5
6A range of mexfiles is predefined in directory \c library/mex.
7Many of these mexfile process ui files (see \ref ui) examples of these files are in directory \c library/tutorial.
8Note that in order to run these files you need to let matlab know where to find them:
9\code
10>> addpath path_to_bdm/library/mex
11\endcode
12
13Then, you can go to \c library/tutorial  and run e.g. \c arx_test_mex.
14
15\section write Howto write custom mex file
16
17Due to special nature of the mex files, the mex file can be split in three parts:
18\li input conversion, where input arguments are converted to IT++ structures,
19\li main body of algorithm, where any C++ bdm constructions can be used,
20\li output conversion, where resulting IT++ structures are converted to mxArrays.
21 
22The first and the third part is achieved using prepared IT++ routines, see IT++ documentation.
23
24Script \c ./buildmex is prepared to compile and link the mexfile with bdm.
25\code
26$ ./buildmex.sh my_mex_file.cpp
27\endcode
28on Linux, or
29\code
30$ ./buildmex.bat my_mex_file.cpp
31\endcode
32on Windows.
33
34Example of a mexfile:
35\include arx1d.cpp
36*/
Note: See TracBrowser for help on using the browser.