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
2
votes
3 answers

Issu using startMATLAB in C++ with "MatlabEngine.hpp" in r2017b

In its new version 2017b, Matlab has released a new MATLAB Engine API for C++: https://fr.mathworks.com/help/matlab/calling-matlab-engine-from-cpp-programs.html When I try to use this API, (only to start Matlab at the beginning !!), I have an issue…
FlorianS
  • 106
  • 9
2
votes
1 answer

"import matlab.engine" works on linux command line but not in Spyder

Matlab engine for python (r2016a) appears to be installed and working with python. I can do the following from a bash prompt: $ python Python 3.4.5 |Anaconda 4.3.1 (64-bit)| (default, Jul 2 2016, 17:47:47) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on…
hbraunDSP
  • 57
  • 7
2
votes
1 answer

Corrupted version of Matlab Engine for python on MacOSX 10.11

I used the Matlab Engine for Python a lot last fall, without any trouble. I just tried to reuse my old code today and I get the following error: >>> import matlab.engine Traceback (most recent call last): File "", line 1, in File…
Cynthia GS
  • 522
  • 4
  • 20
2
votes
0 answers

Infinite busy when using eng.workspace in Python via matlab-engine

I have isolated a problem writing to Matlab workspace via matlab.engine in Python. Can anyone assist? Whenever I call eng.workspace, I 'time out', that is that Matlab goes in to an infinite busy and fails to continue with the script, either in…
H.Baucke
  • 21
  • 4
2
votes
2 answers

Can I debug Matlab Code started via Matlab engine?

I try to run and debug a script file from the matlab engine. Using breakpoints in my C++ program, I could open a Matlab editor and set a breakpoint in my script. When I continue the C++ program, the breakpoint gets hit, but Step through or similar…
2
votes
1 answer

How can I start matlab with a daemon when I'm not active on the computer?

I need to execute several matlab functions on a daily basis. Some of these functions download data from the internet. They fail if the data is not ready yet for example and I want them to try again after some time. In order to implement this I have…
mabe
  • 125
  • 1
  • 10
2
votes
1 answer

engdemo.c on Mac OSX - Can't start MATLAB engine

I'm trying to build and run the Matlab Engine example "engdemo.c" using the instructions from Mathworks. When I try to run it with the command !./engdemo, I'm getting the following error: matlab: Command not found. Can't start MATLAB engine I have…
Eric Miller
  • 110
  • 7
2
votes
0 answers

How solve the "Can't start MATLAB engine" command?

(1) Firstly, I created a Makefile as follows: MATLABROOT=/usr/local/MATLAB/R2011b all: engdemo engdemo: $(MATLABROOT)/bin/mex -f $(MATLABROOT)/bin/engopts.sh $(MATLABROOT)/extern/examples/eng_mat/engdemo.cpp -o engdemo clean: rm -f…
BlueBit
  • 397
  • 6
  • 22
2
votes
1 answer

How to get the PID of matlab when using the MATLAB Engine?

When using the MATLAB Engine interface, how can I get the process ID of the matlab process that is started? Or how can I launch the matlab process in a way that would allow me to also get the PID? The reason why I need this is to be able to…
Szabolcs
  • 24,728
  • 9
  • 85
  • 174
2
votes
1 answer

Get MATLAB Engine to return unicode

The MATLAB Engine is a C interface to MATLAB. It provides a function engEvalString() which takes some MATLAB code as a C string (char *), evaluates it, then returns MATLAB's output as a C string again. I need to be able to pass unicode data to…
Szabolcs
  • 24,728
  • 9
  • 85
  • 174
2
votes
0 answers

Call MATLAB function from a C program

Possible Duplicate: How to call MATLAB code from C? Is there a method to call a MATLAB function from a C program? My task is to calculate a pseudo inverse of a matrix generated in a C program using MATLAB. I want to pass the output obtained from…
1
vote
1 answer

matlab-ruby gem doesn't work when called from thread

I would like to run the Matlab engine (using the gem matlab-ruby) inside a ruby thread. The idea is to use ruby to distribute my Matlab processes onto different cores. However when I try to start a new engine from inside a thread I get a Trace/BPT…
pez
  • 1,034
  • 2
  • 10
  • 23
1
vote
1 answer

How can I use Matlab engine in a mex function called from Matlab

I want to make a mex program that can be called from Matlab, where the user can register a Matlab function to be used for processing. The program will then use this function to process data coming from another program in the background. The…
snowape
  • 1,274
  • 10
  • 23
1
vote
1 answer

Engine functions: Calling MATLAB from a C application

I'm trying to call a user-defined MATLAB function from a C application, but I'm having trouble getting even the simplest engine scenario to work. Below is a program that should simply print a = 1 into the MATLAB command window. But when I run it,…
arafasse
  • 95
  • 4
1
vote
1 answer

'matlab.object' object is not callable using matlab engine

I am trying to use MATLAB engine from Python as follows sinewave = eng.dsp.SineWave("Amplitude",1,"Frequency",fc,"SampleRate",fs,"SamplesPerFrame",nspf,"ComplexOutput",True) sinewave() to use the DSP toolbox. However, I get the error…