?? exm2.c
字號:
/*
* MATLAB Compiler: 2.2
* Date: Tue Jun 25 12:35:15 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" "-m" "-W" "main" "-L"
* "C" "-t" "-T" "link:exe" "-h" "libmmfile.mlib" "exm2" "exm2_f"
*/
#include "exm2.h"
#include "exm2_f.h"
static mxChar _array1_[126] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
'l', 'e', ':', ' ', 'e', 'x', 'm', '2', ' ',
'L', 'i', 'n', 'e', ':', ' ', '1', ' ', 'C',
'o', 'l', 'u', 'm', 'n', ':', ' ', '1', ' ',
'T', 'h', 'e', ' ', 'f', 'u', 'n', 'c', 't',
'i', 'o', 'n', ' ', '"', 'e', 'x', 'm', '2',
'"', ' ', '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', ' ', '(', '0', ')', '.' };
static mxArray * _mxarray0_;
static mxChar _array3_[125] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
'l', 'e', ':', ' ', 'e', 'x', 'm', '2', ' ',
'L', 'i', 'n', 'e', ':', ' ', '1', ' ', 'C',
'o', 'l', 'u', 'm', 'n', ':', ' ', '1', ' ',
'T', 'h', 'e', ' ', 'f', 'u', 'n', 'c', 't',
'i', 'o', 'n', ' ', '"', 'e', 'x', 'm', '2',
'"', ' ', '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', ' ', '(', '0', ')', '.' };
static mxArray * _mxarray2_;
static double _array5_[9] = { 4.0, 0.0, 0.0, 0.0, 3.0, 1.0, 0.0, 1.0, 3.0 };
static mxArray * _mxarray4_;
void InitializeModule_exm2(void) {
_mxarray0_ = mclInitializeString(126, _array1_);
_mxarray2_ = mclInitializeString(125, _array3_);
_mxarray4_ = mclInitializeDoubleVector(3, 3, _array5_);
}
void TerminateModule_exm2(void) {
mxDestroyArray(_mxarray4_);
mxDestroyArray(_mxarray2_);
mxDestroyArray(_mxarray0_);
}
static void Mexm2(void);
_mexLocalFunctionTable _local_function_table_exm2
= { 0, (mexFunctionTableEntry *)NULL };
/*
* The function "mlfExm2" contains the normal interface for the "exm2"
* M-function from file "D:\mywork\exm2.m" (lines 1-4). This function processes
* any input arguments and passes them to the implementation version of the
* function, appearing above.
*/
void mlfExm2(void) {
mlfEnterNewContext(0, 0);
Mexm2();
mlfRestorePreviousContext(0, 0);
}
/*
* The function "mlxExm2" contains the feval interface for the "exm2"
* M-function from file "D:\mywork\exm2.m" (lines 1-4). The feval function
* calls the implementation version of exm2 through this function. This
* function processes any input arguments and passes them to the implementation
* version of the function, appearing above.
*/
void mlxExm2(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
if (nlhs > 0) {
mlfError(_mxarray0_);
}
if (nrhs > 0) {
mlfError(_mxarray2_);
}
mlfEnterNewContext(0, 0);
Mexm2();
mlfRestorePreviousContext(0, 0);
}
/*
* The function "Mexm2" is the implementation version of the "exm2" M-function
* from file "D:\mywork\exm2.m" (lines 1-4). 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 exm2
*/
static void Mexm2(void) {
mexLocalFunctionTable save_local_function_table_
= mclSetCurrentLocalFunctionTable(&_local_function_table_exm2);
mxArray * S = mclGetUninitializedArray();
mxArray * A = mclGetUninitializedArray();
/*
* A=[4,0,0;0,3,1;0,1,3];
*/
mlfAssign(&A, _mxarray4_);
/*
* S=exm2_f(A)
*/
mlfAssign(&S, mlfExm2_f(mclVv(A, "A")));
mclPrintArray(mclVsv(S, "S"), "S");
mxDestroyArray(A);
mxDestroyArray(S);
mclSetCurrentLocalFunctionTable(save_local_function_table_);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -