MEXFunctionTemplates-VS
MEXFunctionTemplates-VS copied to clipboard
Why is the default CPP code different from that in MATLAB official documentation?
The default code created is like:
#include "mex.h"
void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) {
mexPrintf("hello, world\n");
}
But in MATLAB documentation:
#include "mex.hpp"
#include "mexAdapter.hpp"
class MexFunction : public matlab::mex::Function {
public:
void operator()(matlab::mex::ArgumentList outputs, matlab::mex::ArgumentList inputs) {
// Function implementation
...
}
};