Why do I receive an error "Can't index into an empty array" when calling my C++ MEX function in MATLAB?
Show older comments
I have created a short C++ MEX program which outputs a single scalar value. The operator() function for this program is included below:
void operator()(matlab::mex::ArgumentList outputs, matlab::mex::ArgumentList inputs) {
outputs[0][0] = 5;
}
The MEX program compiles without warnings, but I get the following error when I call the MEX function in MATLAB:
Can't index into an empty array
How do I resolve this issue?
Accepted Answer
More Answers (0)
Categories
Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!