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
1
vote
1 answer

Matlab engine and disp() function

I have a script that take some time to execute. I launch it in a C++ function, using Matlab Engine. To monitor the execution of the script, I wanted to add some disp('still alive') into it. However, it does not work, nothing is displayed into the…
CTZStef
  • 1,675
  • 2
  • 18
  • 47
1
vote
1 answer

How to Interface MATLAB with XCode

I'm currently developing part of an iOS project that requires classification algorithms from MATLAB. I have tried building an engine application on XCode but during runtime it crashes due to this error: dyld: Symbol not found: _engOpen Referenced…
Edmund Tan
  • 11
  • 5
1
vote
1 answer

fatal error in integration of MATLAB code and C/C++

I used a sample code from mathworks website to integrate a MATLAB code with C/C++ by a link! As you seen in the code, there is header file as: #include "engine.h" In Linux (Ubuntu), I ran: g++ engdemo.cpp -o mycpp command to create an executable…
BlueBit
  • 397
  • 6
  • 22
1
vote
1 answer

MATLAB C matrix interface: does mxDestroyArray recursively destroy elements of cells and structs?

The question is in the title: does mxDestroyArray() recursively destroy elements of cells and structs? Is is about MATLAB's C matrix library interface. To explain in more detail through a concrete example, suppose that I create a 1 by 1 cell using…
Szabolcs
  • 24,728
  • 9
  • 85
  • 174
1
vote
1 answer

Matlab Engine Problems

I'm trying to run the basic Matlab enginedemo.cpp in VS2010 on Windows 7 and no matter what I do the code: `if (!(ep = engOpen(""))) { fprintf(stderr, "\nCan't start MATLAB engine\n"); return EXIT_FAILURE; }` Always errors. I had both…
Neppinger
  • 148
  • 1
  • 2
  • 16
1
vote
1 answer

When Using engine.h, Getting Matlab to display errors & output in the Command Window

I am using the matlab engine to call some functions from a c++ program, which works fine. The data is passed, function called and results displayed in figures. However, if there is a line in the called matlab function, which causes it to error…
oracle3001
  • 1,090
  • 19
  • 31
0
votes
1 answer

Differencies in Mex-file for Matlab

I have created a Mex-file (.mexw64) from my matlab project using Matlab Coder. The problem is that the output is not the same when I run the mex-file as when I run the project in a normal way. Often the variation in the numbers are really…
0
votes
4 answers

retrieve matlab result in java

I use matlab in my project and I want to retrieve the result of matlab in java. Just I want the result. I want to retrive result of file that I make it in matlab in the java. I use this code but it give me the result in matlab windo and I want only…
asmaa
0
votes
0 answers

ran into a memory leak when trying to pass an array of data from JAVA to MATLAB via putVariable

I am trying to do MATLAB calculations via JAVA using MatlabEngine But I ran into a memory leak when trying to transfer an array of data from JAVA to MATLAB via putVariable. The process occupies all available memory and swap and I don't understand…
0
votes
2 answers

Running background tasks in Django

I'm looking for a package to run background tasks in Django. I came across django-background-tasks but there are compatibility issues with the latest Django version since this package appears to be no longer maintained. I am calling a function…
Natasha
  • 1,111
  • 5
  • 28
  • 66
0
votes
0 answers

Passing path as input argument in matlab.engine

I'm using the following lines of code to run a matlab function (main.m) (I:/xxx/simcode/xxx/main) in python (using matlabe engine ), which takes path as input argument import matlab.engine eng =…
Natasha
  • 1,111
  • 5
  • 28
  • 66
0
votes
0 answers

ERROR: Could not find a version that satisfies the requirement engine (from versions: none) ERROR: No matching distribution found for engine

I am trying to import matlab.engine I keep getting - cmd_obj.run() File "", line 385, in run File "", line 156, in _create_path_list RuntimeError: MATLAB R2023a installation not found. Install to…
mais
  • 3
  • 2
0
votes
0 answers

Matlabengine for Matlab 2019a

Is there a matlabengine version available that would work with Matlab version 2019a? The oldest available version on pypi is 9.9.1, which is compatible with 2020b. Thanks!
Luke Autry
  • 61
  • 5
0
votes
0 answers

MATLAB engine for python - How to build graph with weights

When trying to build the most straightforward graph with weights on Matlab engine with Python - s1 = ['a', 'b', 'c', 'd']; t1 = ['b', 'c', 'd', 'e']; w1 = [10, 20, 30, 40]; g = eng.graph(s1,t1,w1); I'm getting this error: MatlabExecutionError …
0
votes
0 answers

Cannot install matlab.engine

After installing matlab and matlabengine (proof of the pip install in the picture) I get the following error: Exception has occurred: ModuleNotFoundError No module named 'matlab.engine'; 'matlab' is not a package AttributeError: module 'matlab' has…
ThickNicc
  • 21
  • 2