?? test3.c
字號:
/*
* MATLAB Compiler: 2.2
* Date: Tue Jun 25 10:52:36 2002
* Arguments: "-B" "macro_default" "-O" "all" "-O" "fold_scalar_mxarrays:on"
* "-O" "fold_non_scalar_mxarrays:on" "-O" "optimize_integer_for_loops:on" "-O"
* "array_indexing:on" "-O" "optimize_conditionals:on" "-O" "none" "-O"
* "fold_scalar_mxarrays:off" "-O" "fold_non_scalar_mxarrays:off" "-O"
* "optimize_integer_for_loops:off" "-O" "array_indexing:off" "-O"
* "optimize_conditionals:off" "-O" "fold_non_scalar_mxarrays:on" "-x" "-W"
* "mex" "-L" "C" "-t" "-T" "link:mexlibrary" "libmatlbmx.mlib" "test3"
*/
#include "test3.h"
#include "libmatlbm.h"
static mxChar _array1_[128] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
'l', 'e', ':', ' ', 't', 'e', 's', 't', '3',
' ', 'L', 'i', 'n', 'e', ':', ' ', '1', ' ',
'C', 'o', 'l', 'u', 'm', 'n', ':', ' ', '1',
' ', 'T', 'h', 'e', ' ', 'f', 'u', 'n', 'c',
't', 'i', 'o', 'n', ' ', '"', 't', 'e', 's',
't', '3', '"', ' ', 'w', 'a', 's', ' ', 'c',
'a', 'l', 'l', 'e', 'd', ' ', 'w', 'i', 't',
'h', ' ', 'm', 'o', 'r', 'e', ' ', 't', 'h',
'a', 'n', ' ', 't', 'h', 'e', ' ', 'd', 'e',
'c', 'l', 'a', 'r', 'e', 'd', ' ', 'n', 'u',
'm', 'b', 'e', 'r', ' ', 'o', 'f', ' ', 'o',
'u', 't', 'p', 'u', 't', 's', ' ', '(', '1',
')', '.' };
static mxArray * _mxarray0_;
static mxChar _array3_[127] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
'l', 'e', ':', ' ', 't', 'e', 's', 't', '3',
' ', 'L', 'i', 'n', 'e', ':', ' ', '1', ' ',
'C', 'o', 'l', 'u', 'm', 'n', ':', ' ', '1',
' ', 'T', 'h', 'e', ' ', 'f', 'u', 'n', 'c',
't', 'i', 'o', 'n', ' ', '"', 't', 'e', 's',
't', '3', '"', ' ', 'w', 'a', 's', ' ', 'c',
'a', 'l', 'l', 'e', 'd', ' ', 'w', 'i', 't',
'h', ' ', 'm', 'o', 'r', 'e', ' ', 't', 'h',
'a', 'n', ' ', 't', 'h', 'e', ' ', 'd', 'e',
'c', 'l', 'a', 'r', 'e', 'd', ' ', 'n', 'u',
'm', 'b', 'e', 'r', ' ', 'o', 'f', ' ', 'i',
'n', 'p', 'u', 't', 's', ' ', '(', '1', ')',
'.' };
static mxArray * _mxarray2_;
void InitializeModule_test3(void) {
_mxarray0_ = mclInitializeString(128, _array1_);
_mxarray2_ = mclInitializeString(127, _array3_);
}
void TerminateModule_test3(void) {
mxDestroyArray(_mxarray2_);
mxDestroyArray(_mxarray0_);
}
static mxArray * Mtest3(int nargout_, mxArray * x);
_mexLocalFunctionTable _local_function_table_test3
= { 0, (mexFunctionTableEntry *)NULL };
/*
* The function "mlfTest3" contains the normal interface for the "test3"
* M-function from file "D:\mywork\test3.m" (lines 1-6). This function
* processes any input arguments and passes them to the implementation version
* of the function, appearing above.
*/
mxArray * mlfTest3(mxArray * x) {
int nargout = 1;
mxArray * y = mclGetUninitializedArray();
mlfEnterNewContext(0, 1, x);
y = Mtest3(nargout, x);
mlfRestorePreviousContext(0, 1, x);
return mlfReturnValue(y);
}
/*
* The function "mlxTest3" contains the feval interface for the "test3"
* M-function from file "D:\mywork\test3.m" (lines 1-6). The feval function
* calls the implementation version of test3 through this function. This
* function processes any input arguments and passes them to the implementation
* version of the function, appearing above.
*/
void mlxTest3(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
mxArray * mprhs[1];
mxArray * mplhs[1];
int i;
if (nlhs > 1) {
mlfError(_mxarray0_);
}
if (nrhs > 1) {
mlfError(_mxarray2_);
}
for (i = 0; i < 1; ++i) {
mplhs[i] = mclGetUninitializedArray();
}
for (i = 0; i < 1 && i < nrhs; ++i) {
mprhs[i] = prhs[i];
}
for (; i < 1; ++i) {
mprhs[i] = NULL;
}
mlfEnterNewContext(0, 1, mprhs[0]);
mplhs[0] = Mtest3(nlhs, mprhs[0]);
mlfRestorePreviousContext(0, 1, mprhs[0]);
plhs[0] = mplhs[0];
}
/*
* The function "Mtest3" is the implementation version of the "test3"
* M-function from file "D:\mywork\test3.m" (lines 1-6). It contains the actual
* compiled code for that M-function. It is a static function and must only be
* called from one of the interface functions, appearing below.
*/
/*
* function y=test3(x)
*/
static mxArray * Mtest3(int nargout_, mxArray * x) {
mexLocalFunctionTable save_local_function_table_
= mclSetCurrentLocalFunctionTable(&_local_function_table_test3);
mxArray * y = mclGetUninitializedArray();
mxArray * i = mclGetUninitializedArray();
mclCopyArray(&x);
/*
* for i = 1:length(x)-1
*/
{
mclForLoopIterator viter__;
for (mclForStart(
&viter__,
mlfScalar(1),
mlfScalar(mclLengthInt(mclVa(x, "x")) - 1),
NULL);
mclForNext(&viter__, &i);
) {
/*
* x(i) = x(i) + x(i+1);
*/
mlfIndexAssign(
&x,
"(?)",
mclVsv(i, "i"),
mclPlus(
mclVe(mlfIndexRef(mclVsa(x, "x"), "(?)", mclVsv(i, "i"))),
mclVe(
mlfIndexRef(
mclVsa(x, "x"),
"(?)",
mclPlus(mclVv(i, "i"), mlfScalar(1))))));
/*
* end
*/
}
mclDestroyForLoopIterator(viter__);
}
/*
* y=x;
*/
mlfAssign(&y, mclVsa(x, "x"));
mclValidateOutput(y, 1, nargout_, "y", "test3");
mxDestroyArray(i);
mxDestroyArray(x);
mclSetCurrentLocalFunctionTable(save_local_function_table_);
return y;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -