MATLAB COMPILER RELEASE NOTES User's Guide Page 132

  • Download
  • Add to my manuals
  • Print
  • Page
    / 264
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 131
5 Controlling Code Generation
5-16
would use the feval interface. The fo llowing C++ c ode is the corresponding
feval interface(mlxGasket)fromtheSierpinskiGasketexample.Thisfunction
calls the C++
Mgasket function.
//
// The function "mlxGasket" contains the feval interface
// for the "gasket" M-function from file
// "<matlab>\extern\examples\compiler\gasket.m" (lines 1-23).
// The feval function calls the implementation version of
// gasket through this function. This function processes
// any input arguments and passes them to the
// implementation version of the function, appearing above.
//
void mlxGasket(int nlhs,
mxArray * plhs[],
int nrhs,
mxArray * prhs[]) {
MW_BEGIN_MLX();
{
mwArray mprhs[1];
mwArray mplhs[1];
int i;
mclCppUninitializeArrays(1, mplhs);
if (nlhs > 1) {
error(_mxarray0_);
}
if (nrhs > 1) {
error(_mxarray2_);
}
for (i = 0; i < 1 && i < nrhs; ++i) {
mprhs[i] = mwArray(prhs[i], 0);
}
for (; i < 1; ++i) {
mprhs[i].MakeDIN();
}
mplhs[0] = Mgasket(nlhs, mprhs[0]);
plhs[0] = mplhs[0].FreezeData();
}
MW_END_MLX();
}
Input argument
processing
Call M-function
Output argument
processing
Page view 131
1 2 ... 127 128 129 130 131 132 133 134 135 136 137 ... 263 264

Comments to this Manuals

No comments