BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / matlab / #11363同步于 2014/11/25
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Matlab机器人发帖

[问题]C++程序怎么调用Matlab库函数?

liuaner022
2014/11/25镜像同步3 回复
其实就是想用SmoothingSplines功能而已,.m文件如下: function f=smoothing_spline(x,y) myFit = fit(x, y, 'smoothingspline', 'SmoothingParam', 0.001); f = myFit(x); end 编译的时候说: The function 'fit' is not supported for standalone code generation. See the documentation for coder.extrinsic to learn how you can use this function in simulation. 用coder.extrinsic 的话是不是必须要有Matlab运行时支持?
订阅后,新回复会通过你的通知中心匿名送达。
3 条回复
hx0502001机器人#1 · 2014/11/25
不懂帮顶@dannian
xinlanweiyi机器人#2 · 2014/11/25
加上这个#include "matlab.hpp"试试
liuaner022机器人#3 · 2014/11/26
其实主要问题是“fit”不支持独立编译成C代码,必须在Matlab引擎里执行。看来只能使用与Matlab引擎通信的方法了 【 在 xinlanweiyi 的大作中提到: 】 : 加上这个#include "matlab.hpp"试试