M2T(1)

NAME
m2t - Matlab to Tela translator

SYNOPSIS
m2t [ -h ] [ -? ] (give help)
m2t [ -svd ] <file.m >file.t (basic usage)
m2t [ -FSmsvd ] files.m >file.t (many files at once)

DESCRIPTION
m2t is an auxiliary program to be used with tela(1). It translates Matlab function and script M-files to t-files, which can be executed from Tela using the function source.

OPTIONS

-F  Process Function files only, ignore script files.

-S  Process Script files only, ignore function files.

-m  Multi-file mode: generate .t files using .m file basenames.

-s  Silent mode, suppress all warnings.

-v  Verbose mode, output symbol tables etc.

-d  Suppress matrix division warnings. Matlab's matrix division / is translated to /, although in Tela it means pointwise division. Thus m2t by default warns at every / operator it encounters. If the Matlab code never uses / for true matrix divisions, you can safely ignore these warnings. If it does, you must hand-edit the .t file to call LinearSolve.

-h, -?
    Print usage instructions alike this manpage.

BUGS (Really too numerous to list)
m2t does not even try to be a true faithful translator. Almost always you have to edit the resulting code at some places. In short, m2t only translates the basic language constructs correctly, but does not try to do a complete job in translating the semantic and syntax of every possible function that are slightly different in Matlab and Tela. However it does translate some of the most frequently used functions, such as zeros, correctly. In addition to differences in individual functions, there are two other areas where m2t may have considerable difficulties. These are Matlab array constructors [...], where the components are not separated by commas. Leaving the commas out is legal in Matlab but not in Tela. For example, [a 1+ b c +d] is legal in Matlab, and it means [a, 1+b, c, d]. To avoid trouble, always write commas where they belong in any new Matlab code you write. The second problematic issue is in deciding when a reference a(i) means array reference or function call, because in Tela array references use brackets while function calls use parentheses. The translator tries to make an educated guess. For example, if a has been previously assigned to, or if it is one of the function arguments, a(i) is array reference. Sometimes the translator guesses wrong, and you have to be prepared to changing parentheses to brackets or vice versa. The function header should be on one line in order to be interpreted correctly. Some of the function conversions, like zeros(n,n) -> zeros(n) work correctly only when n is a simple expression containing no parentheses.

REPORTING BUGS
If you want to, you can use the usual Tela email aliases <tela-bugs@fmi.fi> and <tela-suggestions@fmi.fi> for m2t as well. However, correcting m2t bugs has a much lower priority than fixing Tela bugs. If you have experience and interest in writing translators, be encouraged to improve m2t and sharing your code with the author!

FILES

*.m (Input) Matlab script or function M-files.

*.t (Output) Tela source code files.

SEE ALSO
tela(1), the Tensor Language.

COPYRIGHT
Copyright 1994, Pekka Janhunen.

COPYING POLICY
GNU General Public License (GPL) version 2 or later.

AUTHORS
Pekka Janhunen <Pekka.Janhunen@fmi.fi>,
Finnish Meteorological Institute/
Dept. of Geophysics (FMI/GEO).