python - 将数组值从 Python 传递到 Matlab
问题描述
所以我想用python调用一个matlab函数。python代码如下:
import matlab.engine
eng = matlab.engine.start_matlab()
gt_data=[(22.304667, 114.180459, 13, 0, 0, 0)]
eng.GNSS_RUMS_main_ver1_SUMO(gt_data)
python脚本已启动,但有时我收到以下错误:
Error using GNSS_RUMS_main_ver1_SUMO (line 79)
An UndefinedFunction error was thrown on the workers for 'times'. This might be because the file containing 'times' is not accessible on the workers. Use addAttachedFiles(pool, files) to specify the required files to be attached. For more information, see the documentation for 'parallel.Pool/addAttachedFiles'.
Caused by:
Undefined function 'times' for input arguments of type 'cell'.
请注意:matlab中gt_data的结构如下:
gt_data{1}= [22.304667 114.180459 13 0 0 0];
从 matlab 运行时,脚本运行良好。
解决方案
推荐阅读
- excel - 在 Mac 上导出为 PDF
- angular - 如何将 Angular 库编译为 ES2016?
- sql-server - 如何在 SQL Server 中用另一列的值替换列的值?以及如何将一列的平均值保存在另一列中?
- xcode - SwiftUI:创建自己的数据类型并使用它们。如何?
- r - 使用 ggplotly 的气泡图 - 使用滑块更改标签
- javascript - 我想将行数据动态添加到 HTML 表
- python - 忽略 .com 和 .org 或 .net 的正则表达式解决方案
- c# - ValidationAttribute 在我的 asp.net mvc 上不起作用?
- java - 为什么我的代码会进入下一行?(爪哇)
- javascript - 用点击序列替换可点击的单词