How can I call a matlab function that takes no arguments using matlab engine C++ API?
I have a matlab function (myFunc) that takes no arguments and returns a matlab string. I want to call this function using the matlab engine C++ API. In all examples I have found in documentation, the functions used receive at least one argument (like sqrt o gcd). I have tried declaring an empty variable and using it like this:
const matlab::data::Array arg;
auto res = matlabPtr->feval(u"myFunc", arg);
The code compiles OK, but when I run it I get the exception error "Default constructed arguments are not allowed"
Is there a way to call this kind of function?
Thank you for your helpI have a matlab function (myFunc) that takes no arguments and returns a matlab string. I want to call this function using the matlab engine C++ API. In all examples I have found in documentation, the functions used receive at least one argument (like sqrt o gcd). I have tried declaring an empty variable and using it like this:
const matlab::data::Array arg;
auto res = matlabPtr->feval(u"myFunc", arg);
The code compiles OK, but when I run it I get the exception error "Default constructed arguments are not allowed"
Is there a way to call this kind of function?
Thank you for your help I have a matlab function (myFunc) that takes no arguments and returns a matlab string. I want to call this function using the matlab engine C++ API. In all examples I have found in documentation, the functions used receive at least one argument (like sqrt o gcd). I have tried declaring an empty variable and using it like this:
const matlab::data::Array arg;
auto res = matlabPtr->feval(u"myFunc", arg);
The code compiles OK, but when I run it I get the exception error "Default constructed arguments are not allowed"
Is there a way to call this kind of function?
Thank you for your help matlab engine, c++ api, feval MATLAB Answers — New Questions