Questions tagged [matlab-engine]

MATLAB Engine is a library to call MATLAB® software from standalone programs, for example written in C/C++ or Fortran.

While files are DLLs encapsulating C/C++ or Fortran code to be used by a main program written in MATLAB, sometimes the inverse is necessary: A main program in C/C++ or Fortran needs to access MATLAB's capabilities. This can be done using MATLAB Engine, which is documented in the MATLAB online help.

Note that a second way to use MATLAB from C/C++ or Fortran is to turn the MATLAB code it be used into a library using MATLAB Compiler.

Questions should have this tag if they are about the use of MATLAB Engine specifically. If the issue also occurs with standalone MATLAB the tag should be avoided and be used instead.

183 questions
0
votes
0 answers

Matlab engine version R2022b inside multiprocessing pool get stuck. Any suggestion?

I developed Python code, version 3.8.5, through which I called R2018a Matlab using matlab engine function to process the data using ubuntu 20.04. I used the pool command from the multiprocessing library and I was able to use 20 threads while using…
Parand
  • 11
  • 1
0
votes
1 answer

Use matlab code in python or get something similar

In my program in need to reconstruct matlab code in python but not in very low level. The problem is that i got following lines of matlab p = sobolset(problem_size, 'Skip', 1e4, 'Leap', 1e3); p = scramble(p, 'MatousekAffineOwen'); rand0 = net(p,…
albi
  • 11
  • 2
0
votes
1 answer

Problem with Pycharm using matlab engine: ModuleNotFoundError: No module named 'matlab'

I'm trying to import matlab.engine in python. I've done it with Python shell and it works fine but when I do it in Pycharm it returns "ModuleNotFoundError: No module named 'matlab'". I've tried searching elsewhere on the internet but couldn't solve…
0
votes
0 answers

Connect Simulink with Python for Reinforcement Learning

I have a simulation in the Simulink. There are multiple instances where it needs an action based on the simulation state at that point. I use Python to run the Reinforcement Learning. My Implementation: Simulink simulation is triggered from python…
0
votes
1 answer

Generate Matlab Plot to Jupyter Notebook

When i run this code to python notebook, generates a plot in MATLAB correctly based on the condition i have assign. I will like to display it to the python notebook and not in the matlab. import matlab.engine m = matlab.engine.start_matlab() …
0
votes
0 answers

FMINCON runs with lower and upper bound variables switched, but doesn't run when bounds are specified correctly

I'm running fmincon function in python via this interface: https://github.com/byuflowlab/pyfmincon If I specify upper and lower bounds as ub = np.array([1.0, 30.0]) lb = np.array([0, 0]) it results in the following error: Unable to resolve the name…
stasia_l
  • 47
  • 6
0
votes
0 answers

How to use matlab engine on python without install matlab?

I am currently working on the project. For that, I need to run some Matlab functions from my python code. I don't have MatLab on my Laptop(running on Windows 10). I searched to find a way to install matlab.engine module in python without MatLab on…
0
votes
0 answers

Pyinstaller matlab-engine problem running the .exe on a different machine

I'm working on an application that uses the matlab engine API for python. The app works fine, without any issue, therefore I wanted to pack it into a single exe. At first I had an issue given by mlarray, that I solved by compiling with: pyinstaller…
Volt85
  • 1
0
votes
0 answers

Matlab engine: License Checkout Failed

I'm trying to figure out why I'm getting a License Checkout Failed when running Matlab Engine from Java. I have this very simple Matlab script: function [] = Test() x = [1 2 3 4 5]; y = [ 4 6 8 5 3]; mdl = fitlm(x,y); mdl end fitlm requires the…
J-bob
  • 8,380
  • 11
  • 52
  • 85
0
votes
1 answer

Is it possible to call matlab.engine from Flask webapp on Google Cloud?

I have a Flask app running in Google Cloud App Engine. I want the user to be able to call MATLAB functions on their local instance - if they have MATLAB installed locally and the correct license, of course. Running locally the app works well using…
MarkB
  • 1
0
votes
1 answer

Errors while trying to use matlab engine from VC++

I'm Using MATLAB R2010a I used this this tutorial in order to call matlab function from C++ and i did every thing said in the tutorial and i compiled the project successfully but when i tried to run it, it requires many dlls which i added them in…
Amr Ramadan
  • 1,259
  • 5
  • 18
  • 29
0
votes
1 answer

How to run matlab script in python when the script lives inside different folder?

I am trying to run matlab script, on python jupyter notebook, using matlab python engine, thus I have three files: matlab script.m python wraper.py jupyter notebook.ipynb I can run it properly when I put all the tree files in the same folder, but…
jajamaharaja
  • 135
  • 14
0
votes
0 answers

Access propreties of ndarray in Matlab

I have imported an python ndarray as a cell in Matlab (data_cell) and now I would like to access the properties of this ndarray, more specifically the shape, to convert any cell to the right type with the right size in MatLab. What I would like to…
JCV
  • 447
  • 1
  • 5
  • 15
0
votes
1 answer

Return variables from python to Matlab

I'm trying to pass some variables from python to Matlab, but I didn't manage. If I pass only one variable it works fine, but since I need to pass more variables with different types (matrix, vector, scalar) doesn't work. this is my code in Python…
JCV
  • 447
  • 1
  • 5
  • 15
0
votes
1 answer

Why Matlab engine does not work on python3.7 via pycharm?

I install matlab.engine on python3.7 (Ubuntu) as explained in the matlab site: cd "matlabroot/extern/engines/python" python setup.py install But when I try to use in Pycharm as: import matlab.engine eng = matlab.start_matlab() tf =…