python - numpy 与 mlabwrap 的 matlab 接口(interface)

标签 python matlab interface mlabwrap

我正在寻找一种简单的方法来可视化我在 numpy 中的一些数据,并且我发现了看起来很有前途的 mlabwrap 包。我正在尝试创建一个简单的绘图,能够随着数据的变化而更新。

这是我要复制的 matlab 代码

>> h = plot([1,2,3], [1,2,3], '-o');
>> set(h, 'XData', [0,0,0]);
>> drawnow();

到 python

>> from mlabwrap import mlab
>> h = mlab.plot([1,2,3], [1,2,3], '-o')
>> mlab.set(h, 'XData', [0,0,0])
>> mlab.drawnow();

但是,倒数第二个命令失败并显示错误消息

error: One or more output arguments not assigned during call to "set".

关于如何解决这个问题有什么建议吗?

最佳答案

也许 mlab 很生气,因为您没有为该 set() 调用保存 matlab 的返回值...

我没有安装这个,someval = mlab.set(h,'XData') 有什么作用?

编辑:您也可以尝试使用 nout...mlab.set(h,'XData',[0,0,0],nout=0)

关于python - numpy 与 mlabwrap 的 matlab 接口(interface),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1934740/

相关文章:

algorithm - 在 Matlab 中彻底排列大小为 20 的向量

asp.net-mvc - ASP.NET MVC - 接口(interface)类型上的自定义模型绑定(bind)器

c# - 从 Python 调用用 C# 编写的函数时,“NoneType”对象不可调用

python - 保留百分比列表以加起来为 100% 的算法

python - 使用最小插值绘制 3D 图

python - x = (10<n) 的 Python 等价物是什么? 10 : n;

java - 遍历 ArrayList 并返回满足 instanceof 检查的对象的 ArrayList

python - 正则表达式:如何匹配重叠模式(可能是特定于 Python 的)

java - matlab细化算法java实现

matlab - 控制散点图条颜色