testing MATLAB dll using mbuild
2 次查看(过去 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
回答(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.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!