mwArray& varargin initialize
4 views (last 30 days)
Show older comments
function plotSignals(varargin)....end
I use mcc to convert it to C++ syntax. varargin is a variable parameter,it can receive dynamic parameters,but in MFC type of varargin is mwArray, how can I initialize this variable? I need to convert three strings to varargin.
I have tried this:
const char* str2[]={"EngSpeed","CurrentGear","filename"};
mwArray my_struct(3,1,3,str2);
but it doesnot make a difference....
Thank you for your help!
0 Comments
Accepted Answer
Kaustubha Govind
on 23 Nov 2011
You need to create a cell array as follows:
mwArray input(1, 3, mxCELL_CLASS);
mwArray arg1("EngSpeed");
mwArray arg2("CurrentGear");
mwArray arg3("filename");
input.Get(1,1).Set(arg1);
input.Get(1,2).Set(arg2);
input.Get(1,3).Set(arg3);
More Answers (1)
Jan
on 23 Nov 2011
varargin is a function, therefore I cannot imagine, why or how ou could initialize it. varargin replies a cell and perhaps you want to create a {1 x 3} cell vector and insert the three strings.
See Also
Categories
Find more on Deploy to C++ Applications Using mwArray API (C++03) in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!