testing MATLAB dll using mbuild
조회 수: 8 (최근 30일)
이전 댓글 표시
Hi,
I want to verify dll generated in MATLAB. Hence I had referred this link below http://blogs.mathworks.com/loren/2011/04/21/deploying-multiple-c-shared-libraries/
my function signarure in matlab is function abc(TName, Flag, varargin)
to run this function from MATLAB command prompt i give his command as below
abc('parm1', 'param2', 'param3', 'path to file 1', 'path to file 2')
I want to know how can I declare the mwArray in .cpp file. I had tried
mwArray param1;
mwArray param2;
mwArray input(1, 3, mxCELL_CLASS);
mwArray arg1('param3');
mwArray arg2('path to fiel 1');
mwArray arg3(path to field 2');
input.Get(1,1).Set(arg1);
input.Get(1,2).Set(arg2);
input.Get(1,3).Set(arg3);
with this I get errors when I execute mbuild command. any help ?
is it possible to single step(debug)
Thanks in advance
댓글 수: 1
답변 (2개)
Kaustubha Govind
2012년 1월 20일
This page seems to suggest that MATLAB Compiler "creates several overloaded methods that implement the MATLAB functions. Each of these overloaded methods corresponds to a call to the generic MATLAB function with a specific number of input arguments". So you could try passing them in as 5 arguments:
mxArray *in1 = mxCreateString("param1");
mxArray *in2 = mxCreateString("param2");
mxArray *in3 = mxCreateString("param3");
mxArray *in4 = mxCreateString("path to file 1");
mxArray *in5 = mxCreateString("path to file 2");
Also, you need mxArray, not mwArray.
참고 항목
카테고리
Help Center 및 File Exchange에서 Deploy to C++ Applications Using mwArray API (C++03)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!