Installation#
This section provides more detailed information about installing RAT for MATLAB and Python users
RAT can be used either by running the m-files directly or using a compiled mex file. RAT ships with a pre-compiled MEX file which is available to download from the Github Release page. To use the mex do the following:
Download the source code and the pre-compiled mex for your operating system.
Extract the source code and the mex files.
Open MATLAB and navigate to the folder containing the RAT source code.
Run addPaths.m which will add the necessary paths
Run your script.
However, if you want to build RAT on your local machine, you need to follow the steps below.
Build the MEX on your local machine
A C/C++ compiler and MATLAB (2021 or later) is required for building the mex. The following MATLAB toolboxes are also required:
MATLAB Coder
MATLAB Compiler
Parallel Computing Toolbox
Statistics and Machine Learning Toolbox (for DREAM Minimizer)
To build the mex, do the following:
Download the RAT source code from the Github Release page.
Open MATLAB and navigate to the folder containing the RAT source code.
Run addPaths.m then run buildScript.m in MATLAB. This will add the necessary paths and builds the MEX file. This could take several minutes depending on your machine.
The MEX files will be created in the RAT/compile folder.
If no error shows up, you should be able to run the MEX file.
The RAT API for Python can be installed from PyPI as follows
pip install RATapi
matlabengine is an optional dependency only required for MATLAB related action such as running MATLAB custom functions and converting RasCAL-1 projects. The version of matlabengine should match the version of MATLAB installed on the computer. For example, if MATLAB 2023a is installed on the computer, matlabengine can be installed as shown below:
pip install RATapi[Matlab-2023a]
Note
MATLAB does not support every version of Python so you have to ensure to use a Python version that is supported by your installed MATLAB, for example, the maximum supported Python version for MATLAB 2023a is 3.10 so you cannot install matlabengine for this MATLAB on Python version 3.11 and above. You can check the Python Compatibility on the MATLAB website.