matlab- Matlab bindings and interface

Safe HaskellNone



Interface to a Matlab engine. This works by spawning a separate matlab process and interchanging data in MAT format.

Note that you cannot use Foreign.Matlab.Engine and Foreign.Matlab.Runtime in the same program. This seems to be a Matlab limitation.



data Engine Source

A Matlab engine instance

newEngine :: FilePath -> IO Engine Source

Start Matlab server process. It will automatically be closed down when no longer in use.

engineEval :: Engine -> String -> IO () Source

Execute matlab statement

engineGetVar :: Engine -> String -> IO (MXArray a) Source

Get a variable with the specified name from MATLAB's workspace

engineSetVar :: Engine -> String -> MXArray a -> IO () Source

Put a variable into MATLAB's workspace with the specified name

engineEvalFun :: Engine -> String -> [EngineEvalArg a] -> Int -> IO [MAnyArray] Source

Evaluate a function with the given arguments and number of results. This automates engineSetVar on arguments (using "hseval_inN"), engineEval, and engineGetVar on results (using "hseval_outN").