Home > Net >  How can I run a MATLAB script in Python without having MATLAB installed
How can I run a MATLAB script in Python without having MATLAB installed

Time:04-07

I'd like to assess video quality using RAPIQUE. This program is implemented in MATLAB, however I do not have a MATLAB installation.

Can I run MATLAB's .m file in Python without having MATLAB installed?

RAPIQUE: vztu/RAPIQUE: [IEEE OJSP'2021] "RAPIQUE: Rapid and Accurate Video Quality Prediction of User Generated Content", Zhengzhong Tu, Xiangxu Yu, Yilin Wang, Neil Birkbeck, Balu Adsumilli, Alan C. Bovik (github.com)

CodePudding user response:

In short: you cannot.

You need to have a working, licensed MATLAB installation, which will be called in the background. Without a working, licensed MATLAB installation you cannot run MATLAB code.
As MATLAB is proprietary, there are only three ways to run MATLAB code: by running the code from the MATLAB IDE (with a valid license of course), running it via the MATLAB engine (through Python, from a terminal with -nodisplay etc), or by compiling it to an executable file with the MATLAB compiler.

A possible workaround would be to export your MATLAB code to C/C using the MATLAB Coder. You can then run the C/C code in whatever editor you like. Alternatively you could check whether the program translates easily into GNU Octave, which is free.

The proper solution, however, would be to translate the actual code to Python.

  • Related