问题标签 [matlab-engine]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - 使用 TextMate 在 Python 上导入 MATLAB 引擎 - Python 意外退出
我正在尝试从 Python 脚本调用 MATLAB 函数。我按照 Mathworks 网站的说明安装了 MATLAB 引擎 API,然后使用以下命令在我的脚本中导入引擎:
(在 Mac OS 上使用 TextMate。)但是我收到一条错误消息,提示引擎安装已损坏。我意识到引擎不支持 Python 3.5,所以我卸载了 Python 并安装了 2.7 版本。从那时起,每次我尝试以这种方式导入引擎时,Python 都会意外退出。奇怪的是,它只发生在使用 TextMate,而不是使用 IDLE,例如。这是我得到的错误:
python - 需要从 python 脚本调用 Matlab 函数
我之前编写了一个 ~150 行的 MATLAB 函数,我希望从 Python 调用它,而不是将整个东西重新编码到 Python 中。
我在网上找到了许多选项(mlabwrap
, matlab_wrapper
),但是它们都相当旧,并且都无法正常安装或运行,每个选项都会引发错误。
我正在运行 32 位 Python 2.7.10 和 64 位 MATLAB R2013a。(顺便说一句,Python 是 32 位而 MATLAB 是 64 位的事实可能是个问题?我在架构方面相当缺乏经验)
最简单的方法是什么?
matlab - 在matlab引擎中创建并编写一个txt文件
在 Matlab 2010a 中,我创建了一个新文件data.txt
并使用以下代码将矩阵写入文件。这有效。
a=[1,2,3;3,4,5];
fid=fopen('C:\Users\TOSHIBA\Desktop\data.txt','wt');
fprintf(fid,'%g\n',a);
fclose(fid);
但是,当我在 matlab 引擎中使用与以下语句相同的命令(用 C 语言编写)时,我无法创建新文件data.txt
或将矩阵写入文件。
我怎样才能解决这个问题?
c++ - 将两个带有 Mxarrays 的向量绘制到 C++ 编译器中
我正在尝试绘制两个向量,如果我已经mxArray
从 MATLAB 存储了两个 s 的元素(使用 Visual C++ 编译器)。
test1
并且test2
是mxArray
MAT 文件中的 s,当我打印它们时就可以了。但是当我运行程序时,这个数字是空白的。
python - MacOSX 10.11 上用于 python 的 Matlab 引擎损坏版本
去年秋天,我经常使用 Matlab Engine for Python,没有遇到任何麻烦。我今天刚尝试重用旧代码,但出现以下错误:
我在 MacOSX 10.11 (El Capitan) 上,使用 Python 2.7 和 Matlab 2015a。我已经重新安装了两次 Matlab 引擎,但没有区别,我仍然得到同样的错误。
查看ini .py 文件,似乎失败的行如下,产生了此处复制的错误:
我已经阅读了一个类似的问题,其中的答案指向 libpython2.7.dylib HERE的问题,但我不确定我是否理解解决方案。我可以在我的/usr/lib/
文件夹中看到 libpython2.7.dylib 文件。
python - Pymatbridge 连接在终端中工作但在 python 脚本中失败
我有一个关于pymatbridge
. 我一直在尝试将它用作 Matlab 引擎的替代品,由于某种原因,它最近对我产生了影响,我无法让它再次工作。我按照Github的说明进行操作,在终端中测试我的脚本时,zmq 连接运行良好,并且每次都建立连接。但是,当我将终端中的工作内容复制粘贴到 python 脚本中时,连接每次都会失败。我对 zmq 不熟悉,但问题似乎是系统性的,所以我想知道我是否缺少明显的东西。这是我的代码。
我最终改用matlab_wrapper,它运行良好,安装和设置容易得多,但我只是想了解为什么pymatbridge
我的脚本失败但在终端中工作。顺便说一句,我在这篇文章的惊人答案(向下滚动,第三个答案)pymatbridge
中了解了这两者。matlab_wrapper
ruby-on-rails - Matlab 引擎在轨道上使用红宝石“运行”
我创建了一个 Ruby on Rails Web 应用程序。这个应用程序在最后为一个在 Matlab 中制定的问题创建了一个输入数据文件。现在我想借助 Web 应用程序中的按钮启动 Matlab 问题。如何从 Ruby on Rails 启动 Matlab?我尝试了以下但没有成功:
有没有人解决我的问题?
c++ - Explain the use of memcpy (MatLab engine)
I have a background in running simulations in MatLab, and am currently learning C++ to run the simulations whilst still using MatLab to plot through the MatLab engine. The code below shows an example piece of code I have written to generate a variable, pass it to the MatLab workspace, plot it, then pass another variable back to C++.
The part that I am specifically interested in is this...
I have absolutely no idea what this piece of code is doing. I have had a look at the documentation (http://www.cplusplus.com/reference/cstring/memcpy/) and it hasn't exactly enlightened me. The part that I particularly don't get is the use of (void *). As I stated, my background is in MatLab, so I'm not exactly an expert in C++, so if anyone could explain what is happening here as if I am a five year old, it would be very much appreciated!
Thanks,
Seb.
c++ - 调用 MATLAB 引擎错误:您的计算机中缺少 libeng.dll
尽管有很多在线资源可以解决这个问题,但我仍在努力从一个简单的 .cpp 程序调用 MATLAB。
我的目标:
使用 Microsoft Visual Studio 2010 Professional 64 位构建 .cpp 程序,该程序调用 MATLAB 引擎以获得内置函数和图形(MATLAB R2013b 64 位)
我做了什么:
在 .cpp 文件属性页中,我有: 1) 将平台更改为 Active(x64) 2) 将以下路径添加到 VC++ 目录可执行目录:C:\Program Files\MATLAB\R2013b\bin 包含目录:C: \Program Files\MATLAB\R2013b\extern\include 参考目录:C:\Program Files\MATLAB\R2013b\bin\win64 库目录:C:\Program Files\MATLAB\R2013b\extern\lib\win64\microsoft
3)编写以下程序:
收到的错误:
“程序无法启动,因为您的计算机中缺少 libeng.dll。尝试重新安装程序来解决这个问题。”</p>