Just transform the one "main" function into a mexFunction. Then that will call all the underlying C++ functions. There is only one mexFunction ... your converted "main" function. The others are not mexFunctions per se, they are simply supporting code for your one mexFunction. To compile, be sure to include all source code .cpp files on the mex command line (do not put anything on the command line that is #include in your files such as header files). E.g., for 20 files you would have something like this:
> mex mymain.cpp source2.cpp source3.cpp source4.cpp ... source20.cpp
Where the ... are actually replaced by all the file names. I.e., list all the files on one line. Also, be sure your current default directory is the directory that has all your source code and header files. If you have any library files then include them on your mex command line along with the source code files.


