2023-10-05 10:38:21 +08:00
|
|
|
|
#include <iostream>
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
#include "mex_func.h"
|
|
|
|
|
|
#include "CommonLib/matlab_io.h"
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, const char** argv)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
2023-10-07 04:21:54 +08:00
|
|
|
|
//string matFile = "D:\\x_large.mat";
|
2023-10-05 10:38:21 +08:00
|
|
|
|
//string matFile = "D:\\x.mat";
|
2023-10-07 04:21:54 +08:00
|
|
|
|
//string matFile = "D:\\Twirls\\wd_small.mat";
|
|
|
|
|
|
//string matFile = "D:\\Twirls\\wd.mat";
|
|
|
|
|
|
clock_t begin = clock(), finish;
|
|
|
|
|
|
string wd2Mat = "D:\\wd2_5w.mat";
|
|
|
|
|
|
string dicrMat = "D:\\dicr.mat";
|
|
|
|
|
|
string wdMat = "D:\\wd.mat";
|
2023-10-05 10:38:21 +08:00
|
|
|
|
|
2023-10-07 04:21:54 +08:00
|
|
|
|
//string dicrMat = "D:\\dicr_large.mat";
|
|
|
|
|
|
//string wdMat = "D:\\wd_large.mat";
|
|
|
|
|
|
|
|
|
|
|
|
MATFile* pwdMat, *pwd2Mat, *pdicrMat;
|
|
|
|
|
|
mxArray* prhs[4];
|
|
|
|
|
|
|
|
|
|
|
|
pwdMat = matOpen(wdMat.c_str(), "r");
|
|
|
|
|
|
pwd2Mat = matOpen(wd2Mat.c_str(), "r");
|
|
|
|
|
|
pdicrMat = matOpen(dicrMat.c_str(), "r");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
prhs[0] = matGetVariable(pwdMat, "wd"); //获取.mat文件里面名为matrixName的矩阵
|
|
|
|
|
|
prhs[1] = matGetVariable(pwd2Mat, "wd2");
|
|
|
|
|
|
// prhs[1] = mxCreateString("D:\\Twirls\\gat1\\literatures\\temp\\wd2s.txt");
|
|
|
|
|
|
prhs[2] = matGetVariable(pdicrMat, "dicr");
|
2023-10-05 10:38:21 +08:00
|
|
|
|
|
|
|
|
|
|
mxArray* plhs = (mxArray*)malloc(sizeof(mxArray*));
|
|
|
|
|
|
|
|
|
|
|
|
mxArray** arg = &prhs[0];
|
|
|
|
|
|
|
2023-10-07 04:21:54 +08:00
|
|
|
|
mexFunction(1, &plhs, 3, arg);
|
2023-10-05 10:38:21 +08:00
|
|
|
|
//mexFunction(0, 0, 0, 0);
|
|
|
|
|
|
|
2023-10-07 04:21:54 +08:00
|
|
|
|
finish = clock();
|
|
|
|
|
|
cout << "mexFunction Total time: " << (double)(finish - begin) / CLOCKS_PER_SEC << " s" << endl;
|
2023-10-05 10:38:21 +08:00
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|