33.13. Matlab Interface

This is an interface to the Matlab C API.

The package MATLAB is :CASE-SENSITIVE, so you would write (matlab:engOpen ...) when you need to call engOpen.

When this module is present, *FEATURES* contains the symbol :MATLAB.

Additionally, some higher level functionality is available (see modules/matlab/test.tst for sample usage):

(matlab:matfile-content mf)
Return a VECTOR of STRINGs naming the variables in file mf (opened using matOpen).
matlab:*command*
The default argument to engOpen.
matlab:*engine*
The currrently open Matlab engine.
(matlab:engine)
Make sure *engine* is valid and return it.
(matlab:with-engine (&OPTIONAL engine command) &BODY body)
Run the body wuth the engine bound to a Matlab engine (default *engine*). The engine is opened with engOpen, then closed with engClose.
(matlab:with-MATfile (file name &OPTIONAL mode) &BODY body)
matOpen the matlab file, do the body, matClose it.
(matlab:copy-lisp-to-mxArray lisp-array &OPTIONAL matlab-matrix)
Copy data from the 2-dimensional lisp array to the Matlab matrix.
(matlab:copy-lisp-to-matlab lisp-array matlab-variable &KEY engine)
Copy the 2-dimensional lisp array to the Matlab variable (a STRING) in the supplied engine (defaults to *engine*).
(matlab:copy-mxArray-to-lisp matlab-matrix &OPTIONAL lisp-array)
Copy the matlab matrix to the 2-dimensional lisp array (created anew or re-used if supplied).
(matlab:copy-matlab-to-lisp matlab-variable &OPTIONAL lisp-array &KEY engine)
Copy data from the matlab variable to the 2-dimensional lisp array (created anew or re-used if supplied).
(matlab:invert-matrix lisp-array &KEY engine)
Invert the lisp matrix using the specified engine.

These notes document CLISP version 2.49+Last modified: 2016-09-05