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 Java Exeption Unable to launch matlab

I am trying to use matlab from java using the java engine (Working on Ubuntu 16.04 and the trial of Matlab 2017a. Also, I'm following the code posted in the official page of Matlab (…
1
vote
0 answers

Calling Matlab fun from Python 2 is very slow

I am trying to call a matlab function from python 2.7 script. I am using Matlab engine for Python(Matlab Engine From Mathwork). But it seems very slow. The last line of my python code( check snippet below), takes 5 minutes but same matlab function…
Sherlock
  • 993
  • 1
  • 10
  • 22
1
vote
0 answers

import matlab.engine hangs (R2016a)

I'm trying to use the Matlab Engine API for Python and I installed using standard procedure on Matlab's site. However, it takes forever and doesn't show any prompts. Until I manually break and exit. Any installation issues that I'm missing here?…
Raaj
  • 1,180
  • 4
  • 18
  • 36
1
vote
1 answer

Calling MATLAB from a DLL

I have a DLL written in C++ that is used to modify parameters in VISSIM (traffic simulator). Within this DLL, I would like to call MATLAB to send data, perform MATLAB functions, and return data to the DLL. This all occurs outside of an IDE as VISSIM…
E. Wash
  • 21
  • 1
  • 6
1
vote
2 answers

Calling MATLAB Engine error: libeng.dll is missing from your computer

I am struggling to call MATLAB from a simple .cpp program despite the many resources online for this problem. My Objective: Use Microsoft Visual Studio 2010 Professional 64-bit to build .cpp program that calls MATLAB Engine for built-in functions…
E. Wash
  • 21
  • 1
  • 6
1
vote
0 answers

Pymatbridge connection working in terminal but failing in python script

I have a question regarding the pymatbridge. I have been trying to use it as an alternative to the Matlab Engine, which for some reason broke on me recently and I haven't been able to get it to work again. I followed the instructions from Github and…
Cynthia GS
  • 522
  • 4
  • 20
1
vote
1 answer

create and write a txt file in matlab engine

In Matlab 2010a, I create a new file data.txt and write a matrix into the file using the following codes. And this works. a=[1,2,3;3,4,5]; fid=fopen('C:\Users\TOSHIBA\Desktop\data.txt','wt'); fprintf(fid,'%g\n',a); fclose(fid); However, when I…
chen zhong
  • 11
  • 2
1
vote
1 answer

call matlab neural network function from matlab python engine

I am trying to use the matlab neural network toolbox from matlab python engine. Suppose for example I want to emulate the following example http://uk.mathworks.com/help/nnet/ref/fitnet.html net = fitnet(10); net = train(net,x,t); view(net) y =…
Donbeo
  • 17,067
  • 37
  • 114
  • 188
1
vote
1 answer

matlab engine data retrieval fails

I have a problem reading out data from the matlab engine. I can create a variable in the engine, and saving the workspace and subsequently loading it into matlab shows that the variable exists and has the right value. However the C++ value that I…
Vera
  • 769
  • 1
  • 6
  • 16
1
vote
2 answers

Engine Matlab issues

I am triyng to implement Matlab in a c++ program. http://www.cl.cam.ac.uk/~sjeh3/wii/ The application is using gtk a wii mote lib and the Matlab Camera Calibration Toolbox (http://www.vision.caltech.edu/bouguetj/calib_doc/ ). it works perfectly. I…
Hugo Serrat
  • 149
  • 2
  • 12
1
vote
0 answers

what is the way for solving link errors for matlab R2012a with visual studio 2010

Using visual studio 2010 and Matlab R2012a (32 -bit) and on a 32bit platform: I want just to call a function from matlab in c++ using matlab engine. I get the matlab function output in a separate solution and it works well; I did the same setting…
1
vote
1 answer

c++ get double array from Matlab engine

I have C++ code which calls MATLAB function using MATLAB engine. The MATLAB function result is an array of 3 doubles. How can I get that array back to C++ as a double array ?
user2824393
  • 639
  • 3
  • 10
  • 19
1
vote
2 answers

Spawn multiple copies of matlab on the same machine

I am facing a huge problem. I built a complex C application with embedded Matlab functions that I call using the Matlab engine (engOpen() and such ...). The following happens: I spawn multiple instances of this application on a machine, one for…
megavore
  • 127
  • 1
  • 10
1
vote
3 answers

trying to access matlab from c++ using header

I'm trying to compile a c++ program which contains Matlab's provided engine header. File MLP.cpp contains: #include #include #include #include using namespace std; And references the matlab functions…
1
vote
1 answer

Error linking Matlab with C++

I'm trying to use Matlab library in C++ program: #include #include #include #include "engine.h" using namespace std; int main(int argc, char** argv) { Engine* mweng = engOpen(""); engEvalString(mweng, "n =…
Everv0id
  • 1,862
  • 3
  • 25
  • 47