Name

mat2latex — Convert a matrix into LaTex matrix or LaTex table

CALLING SEQUENCE

mtex = mat2latex(mat,arg1,…,argn)

PARAMETERS

Input

• mat = a (n x k) matrix

• arg1,…,argn = arguments which can be:

 - 'rowtit=xx' a n-dimension string vector of row titles

 - 'coltit=xx' a k-dimension string vector of columns titles

 - 'caption=xx' the table caption or title

 - 'digits=xx' a (1 x 1) or a k-dimensional vector indicating the number of digits to display in each columns

• (default = all)

 - 'align=xx' a (1 x 1) or a k-dimensional vector indicating the alignment of the corresponding columns (default = center for all)

     *'c': center

     *'l': left

     *'r': right

 - 'float=xx' a string indicating the position of table (default='!ht')

    * 'b': bottom of the page

    * 't': top of the page

    * 'h': at the very place in the text where it occurs

    * 'p': on a special page containing only floats

    * '!': without considering most of the internal parameters which could stop this float from being placed

 - 'label=xx' the LaTex anchor

 - 'path=xx' a path where the file has to be saved and the name of the file ex: c:\mypath\mybable.tex'

Output

• mtex = a string formed of the LaTex code

DESCRIPTION

Convert a matrix into matrix or a table in LaTex code.

EXAMPLE

Example taken from function mat2latex():
 caption='My beautiful LaTex table (\%)'
 digits=2
 rowtit='r'+string(1:n)
 coltit='c'+string(1:k)
 align="c"
 float='!ht'
 path='SCI\macros\grocer\db\mlatex.tex'
 mlatex=mat2latex(mat,'caption=caption','rowtit=rowtit','coltit=coltit','align=align','digits=2','path=path');
 
 
When no row titles, column titles, caption are not specidfied then a simple matrix is created.
When the label obtion is filed the matrix equation is numbered
 
               

AUTHOR

Emmanuel Michaux 2009