Install the MATLAB module

This is a simple module that allows exchanging matrices and variables from/to the Matlab environment with simple C++ function calls in Chrono::Engine.

Read the introduction to modules for a technical background on the modularity of the Chrono::Engine project.

## Features

The Matlab module is used to provide an easy way to call Matlab functions from your Chrono::Engine -based application. Basically, you can

• call Matlab commands from your C++ program,
• send/retrieve data to/from Matlab (the Chrono::Engine C++ matrices are converted to Matlab, and viceversa)
• use the Matlab powerful visualization tools, to show simulation data in 2D/3D plots, etc.

## Requirements

• To run applications based on this module:
• you must have a licensed copy of Matlab(TM) installed on your system. We tested it from the 2006 revision up to the most recent.
• your PATH environment variable must contain the path to the libeng.dll (see below)
• To build applications based on this module:
• you must have a licensed copy of Matlab(TM) installed on your system. We tested it from the 2006 revision up to the most recent.

## Building instructions

1. Repeat the instructions for the full installation, but when you see the CMake window, you must add the following steps:
2. Set the ENABLE_MODULE_MATLAB as 'on', then press 'Configure' (to refresh the variable list)
3. Set the CH_MATLAB_SDK to the path where you have your Matlab '/extern' subdirectory. This changes depending on where you installed Matlab. For example, it could be C:/Program Files/MATLAB/R2015b/extern
4. Press 'Configure' again, then 'Generate', and proceed as usual in the installation instructions.
In most cases, when you run an executable that uses the Matlab module, you will get an error message from Windows, telling that the libeng.dll library cannot be found. This means that you must tell Windows the path where to find it; so you need to modify the PATH system variable. Do the following:

[matlabroot "\bin\win64"]
(or [matlabroot "\bin\win32"] on a 32 bit platform). You get the path to the dll on your system.
2.type !matlab -regserver