0
如何將Eigen Matrix作爲Matlab輸出參數傳遞?將C++特徵矩陣傳遞給Matlab mex輸出
我想這從[EIGEN] How to get in and out data from Eigen matrix:
MatrixXd resultEigen; // Eigen matrix with some result (non NULL!)
double *resultC; // NULL pointer
Map<MatrixXd>(resultC, resultEigen.rows(), resultEigen.cols()) = resultEigen;
但它缺乏信息,如何通過在resultC到plhs [0]的信息?另外,當我使用這個Map運行代碼時,Matlab關閉。
你不能''Eigen矩陣'''Matlab'。你可以做的是使用'Eigen'計算大量數據,並使用底層數據創建一個對象,該對象可以被'Matlab'理解並添加到'plhs'中。 –