                               README

The files in this directory fall into two categories:

   * Example source code files; some are written as M-files and 
     some are written in the C language. 
   * Files to help you build and configure the source code files into 
     stand-alone external applications.

The "MATLAB Compiler User's Guide" details most of the files in this
directory.



                   *******************************
                      EXAMPLE SOURCE CODE FILES
                   *******************************



squibo.m: A Sample M-File
-------------------------

The "MATLAB Compiler User's Guide" details various ways to compile squibo.m. 
This M-file calculates "squibonacci" numbers, which are a variant of Fibonacci
numbers.

Compile squibo.m into an optimized MEX-file by typing:

   >> mcc -ri squibo.m 


tridi.m: Another Sample M-file
------------------------------

tridi.m solves a tridiagonal system of equations.

Compile tridi.m into an optimized MEX-file by typing:

   >> mcc -ri tridi.m

NOTE: The "MATLAB Compiler User's Guide" does not detail this example.  
      It does, however, provide an excellent example of the speed 
      advantages of the compiler.  Try running this example as an M-file.
      Then, compile the M-file into a MEX-file and see how much faster it
      runs. 


main.m and mrank.m: Build Two M-Files Into a Stand-Alone External Application
-----------------------------------------------------------------------------

Chapter 5 of the "MATLAB Compiler User's Guide" explains how to build 
two M-files into a stand-alone external application.  The two sample
M-files are: 

   * main.m, which is a function M-file that calls mrank. 
   * mrank.m, which is a function M-file that calculates the rank of
     n magic squares.

See the "MATLAB Compiler User's Guide" for details on building this 
application.


mrank.m and mrankp.c: Build an M-File and C file into a Stand-Alone
-------------------------------------------------------------------

Chapter 5 of the "MATLAB Compiler User's Guide" explains how to build 
an M-file and C file into a stand-alone external application.  A simple
example M-file and C file combination is: 

   * mrankp.c, which is a main C function that calls mrank and prints the
     results returned by mrank.
   * mrank.m, which is a function M-file that calculates the rank of
     n magic squares.

See the "MATLAB Compiler User's Guide" for details on building this 
application.


multargp.c and multarg.m: Advanced Example
-----------------------------------------

Chapter 5 of the "MATLAB Compiler User's Guide" describes a more complicated
example of coding a stand-alone external application.  The sample files
in this example are:

   * multargp.c, which is a C function that calls multarg and prints
     the results returned by multarg.
   * multarg.m, which is a function M-file that contains two input and 
     two output arguments.

See the "MATLAB Compiler User's Guide" for details on building this 
application.




                   *******************************************
                      FILES TO BUILD AND CONFIGURE EXAMPLES 
                   *******************************************

* DOT.mexrc.sh, which is an example .mexrc.sh file.  The UNIX version of
  cmex gets configuration information from .mexrc.sh files.  You may
  need to edit this file.
 
* Makefile, which is an example UNIX Makefile for building 
  external applications.  You need "gmake" (the GNU version of make) 
  in order to build an external application from this Makefile.  

* mccbuild, which is a shell script that builds any collection
  of MATLAB Compiler generated C files into an external application.
