MATLAB dll in Visual C++

조회 수: 2 (최근 30일)
dequan
dequan 2018년 2월 11일

This is my MATLAB function:

if true
  function [c] = myfittest(x, y)
 c=x+y;
 return;
end
end
i have tested the matlab2015a(64bit) and matlab2017a(64bit),and  the vs is vs2013(64bit)
if true
  int main(int argc, char *argv[])
{
	int a = 4;
	int b = 3;
	int c;
	
	if (!myfittestInitialize())  //初始化库文件,在.h文件中有定义,Mytest为生成文件名
	{
		cout << "Mytest Initialize failed!"<< endl; 
		return 0;
	}

mwArray mwa(1, 1, mxUINT32_CLASS); //给输入参数A赋值 mwa.SetData(&a, 1);

mwArray mwb(1, 1, mxUINT32_CLASS); //给输入参数B赋值 mwb.SetData(&b, 1);

mwArray mwy(1, 1, mxUINT32_CLASS);

myfittest(1, mwy, mwa, mwb); //调用test函数,该函数在.h中有定义 //第一个参数:.m文件中test函数对应的输出参数个数 //第二个参数:.m文件中test函数对应的输出参数C //第三个参数:.m文件中test函数对应的输入参数A //第四个参数:.m文件中test函数对应的输入参数B mwy.GetData(&c, 1); //获取test计算结果C

cout c << endl; myfittestTerminate(); //结束end 在.h中有定义 } end the error is <</matlabcentral/answers/uploaded_files/104358/QQ%E5%9B%BE%E7%89%8720180211193931.png> and when i add the the environment variables of the mclmcrrt8_5.dll

, the myfittestInitialize() return fail

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!