1
votes

I am trying to create a CI/CD pipeline with GitLab. In this CI/CD pipeline, matlab unit tests should be executed (class-based unit tests). For this pipeline I use the Matlab Runtime in a Linux docker. The Matlab Runtime is installed in the docker and the project files are also in the docker.

My Question: How can I run a matlab (*.m) file in this Linux docker with a terminal command? And is it even possible to run matlab files with the MCR?

Thanks for your help

2

2 Answers

2
votes

You cannot run M-files using the MATLAB Runtime. The MATLAB Runtime is to run packages created with the MATLAB Compiler. Someone with a MATLAB license, and a MATLAB Compiler license, must compile the code so that it can run with the MATLAB Runtime.

0
votes

You can start from terminal by simply using the command matlab, if the binary path is on your path variable (Documentation).

I would prefer to use it for unit tests like in this example (compatible with MATLAB R2019b).

matlab -sd "${START_DIRECTORY}" -batch "${TEST_FILE}"