matlab-engine

Input arguments for MATLAB Engine function

自闭症网瘾萝莉.ら 提交于 2020-07-04 00:23:03
问题 I'm trying to use MATLAB engine to call a MATLAB function in Python, but I'm having some problems. After manage to deal with NumPy arrays as input in the function, now I have some error from MATLAB: MatlabExecutionError: Undefined function 'simple_test' for input arguments of type 'int64'. My Python code is: import numpy as np import matlab import matlab.engine eng = matlab.engine.start_matlab() eng.cd() Nn = 30 x= 250*np.ones((1,Nn)) y= 100*np.ones((1,Nn)) z = 32 xx = matlab.double(x.tolist(

Engine Matlab issues

落花浮王杯 提交于 2020-01-14 05:05:40
问题 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 want to use matlab ploting tools to build a graphic provided by the application. But i am having issues building the app with matlab engine . In the main.cpp i just added the code from the matlab example engdemo.cpp in the main function and included

Engine Matlab issues

被刻印的时光 ゝ 提交于 2020-01-14 05:04:40
问题 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 want to use matlab ploting tools to build a graphic provided by the application. But i am having issues building the app with matlab engine . In the main.cpp i just added the code from the matlab example engdemo.cpp in the main function and included

Data streaming in MATLAB with input data coming in from a C++ executable

有些话、适合烂在心里 提交于 2020-01-01 12:08:25
问题 I'm completely new to MATLAB and I want to know what my options are for data streaming from a C++ file. I heard of using the MATLAB "engine" for this purpose, and some of the methods like engPutVariable, etc., but can someone give me a thorough example of how to go about doing it? I'm trying to implement streaming a sine wave, but a simple example of sending a sample set of data through should suffice. 回答1: You have two options: the matlab engine and mex functions. It's very important to note

How do I use Matlab engine in my code (for calling `engOpenSingleUse()`)?

戏子无情 提交于 2019-12-31 01:58:24
问题 I'm trying to send simple string commands to the Matlab engine. This is my code (there is no Matlab API related code anywhere else in my code, except for the #include "engine.h" line): void MatlabPlotter::DrawInMatlab() const { std::string PlotCommand = "x=[0 1 2 3 4 5];y=[0 1 4 9 16 25];plot(x, y);"; void * vpDcom = NULL; int iReturnValue; engOpenSingleUse(PlotCommand.c_str(), vpDcom, &iReturnValue); } The code compiles and runs successfully without any compiler errors or run time error

Calling matlab from C++

扶醉桌前 提交于 2019-12-28 16:17:12
问题 I tried to call matlab from a .cpp file. I used the following command to compile engdemo.cpp which includes "engine.h" g++ engdemo.cpp -I/usr/local/matlabR2010a/extern/include -L/usr/local/matlabR2010a/extern/lib -o engdemo What I got is the following: engdemo.cpp:(.text+0xdb): undefined reference to `engOpen' engdemo.cpp:(.text+0x12d): undefined reference to `mxCreateDoubleMatrix' engdemo.cpp:(.text+0x143): undefined reference to `mxGetPr' engdemo.cpp:(.text+0x175): undefined reference to

Issu using startMATLAB in C++ with “MatlabEngine.hpp” in r2017b

Deadly 提交于 2019-12-24 03:06:01
问题 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 using : std::unique_ptr<MATLABEngine> matlabPtr = startMATLAB(); The compilation is ok, but at the execution : Here is the call stack: matlab::engine::initSession --> matlab::engine::startMATLAB --> matlab::engine::startMATLABAsync --> engine

Using Matlab “engine.h” from c++ correctly

痞子三分冷 提交于 2019-12-24 02:07:43
问题 I have a code that proceses frames in each iteration and generatesa matrix. My final goal is to send the matrix data to matlab in order to examine the evolution of the matrix with each frame. In order to achieve this I defined a static variable Engine in a header file (helper.h). #include "engine.h"; #include "mex.h"; static Engine *engine; In the main() program I open the engine only once: #include helper.h main(){ if (!(engine = engOpen(NULL))) { MessageBox ((HWND)NULL, (LPSTR)"Can't start

Corrupted version of Matlab Engine for python on MacOSX 10.11

痴心易碎 提交于 2019-12-23 22:53:43
问题 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 "<stdin>", line 1, in <module> File "/Library/Python/2.7/site-packages/matlab/engine/__init__.py", line 59, in <module> raise EnvironmentError('The installation of MATLAB Engine for Python is ' EnvironmentError: The installation of MATLAB Engine for Python is corrupted. Please reinstall