使用MEX将MATLAB向量传递到C ++特征

问题描述

我正在尝试使用MEX类将MATLAB向量传递给C ++中的Eigen:

#include <stdio.h>
#include "mexAdapter.hpp"
#include "mex.hpp"
#include <math.h>
#include <cmath>
#include <vector>
#include <stdio.h>
#include <tuple>
#include <Eigen/Dense>


using namespace matlab::data;
using namespace std;
using namespace Eigen;
using matlab::mex::ArgumentList;
ArrayFactory factory;

class MexFunction : public matlab::mex::Function {
public:
    void operator()(matlab::mex::ArgumentList outputs,matlab::mex::ArgumentList inputs) {
        
    VectorXd m;
    m = Map<VectorXd>(inputs[0]);

}
};

冒犯似乎是因为没有将MATLAB TypedArray从Eigen转换为Vectorxd。有办法使这项工作吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...