📄 addarray.cpp
字号:
//
// MATLAB Compiler: 3.0
// Date: Thu May 20 14:43:44 2004
// 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" "-silentsetup" "-d"
// "D:/MATLAB6p5p1/work/book/dataconversion/arraypass/arraycom/src" "-v" "-B"
// "cppcom:arraypasscom,arraypasscom,1.0" "-B"
// "ccom:arraypasscom,arraypasscom,1.0" "-t" "-W"
// "com:arraypasscom,arraypasscom,1.0" "-T" "link:lib" "-h" "libmmfile.mlib"
// "-i" "-L" "cpp" "-g" "-G" "-A" "debugline: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" "speculate:off" "-i"
// "D:/MATLAB6p5p1/work/book/dataconversion/arraypass/mfiles/addarray.m"
// "D:/MATLAB6p5p1/work/book/dataconversion/arraypass/mfiles/addcomplexarray.m"
// "D:/MATLAB6p5p1/work/book/dataconversion/arraypass/mfiles/displayarray.m"
//
#include "addarray.hpp"
#include "libmatlbm.hpp"
void InitializeModule_addarray() {
}
void TerminateModule_addarray() {
}
static mwArray Maddarray(int nargout_, mwArray x);
_mexLocalFunctionTable _local_function_table_addarray
= { 0, (mexFunctionTableEntry *)NULL };
//
// The function "addarray" contains the normal interface for the "addarray"
// M-function from file
// "d:\matlab6p5p1\work\book\dataconversion\arraypass\mfiles\addarray.m" (lines
// 1-8). This function processes any input arguments and passes them to the
// implementation version of the function, appearing above.
//
mwArray addarray(mwArray x) {
int nargout = 1;
mwArray y = mwArray::UNDEFINED;
y = Maddarray(nargout, x);
return y;
}
//
// The function "mlxAddarray" contains the feval interface for the "addarray"
// M-function from file
// "d:\matlab6p5p1\work\book\dataconversion\arraypass\mfiles\addarray.m" (lines
// 1-8). The feval function calls the implementation version of addarray
// through this function. This function processes any input arguments and
// passes them to the implementation version of the function, appearing above.
//
void mlxAddarray(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
MW_BEGIN_MLX();
{
mwArray mprhs[1];
mwArray mplhs[1];
int i;
mclCppUndefineArrays(1, mplhs);
if (nlhs > 1) {
error(
mwVarargin(
mwArray(
"Run-time Error: File: addarray Line: 1 Column: "
"1 The function \"addarray\" was called with mor"
"e than the declared number of outputs (1).")));
}
if (nrhs > 1) {
error(
mwVarargin(
mwArray(
"Run-time Error: File: addarray Line: 1 Column: "
"1 The function \"addarray\" was called with mor"
"e than the declared number of inputs (1).")));
}
for (i = 0; i < 1 && i < nrhs; ++i) {
mprhs[i] = mwArray(prhs[i], 0);
}
for (; i < 1; ++i) {
mprhs[i].MakeDIN();
}
mplhs[0] = Maddarray(nlhs, mprhs[0]);
plhs[0] = mplhs[0].FreezeData();
}
MW_END_MLX();
}
//
// The function "Maddarray" is the implementation version of the "addarray"
// M-function from file
// "d:\matlab6p5p1\work\book\dataconversion\arraypass\mfiles\addarray.m" (lines
// 1-8). 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]=addarray(x)
//
static mwArray Maddarray(int nargout_, mwArray x) {
mclMlineEnterFunction(
"d:\\matlab6p5p1\\work\\book\\dataconve"
"rsion\\arraypass\\mfiles\\addarray.m",
"addarray")
mwLocalFunctionTable save_local_function_table_
= &_local_function_table_addarray;
mwArray y = mwArray::UNDEFINED;
//
// %function [y]=addarray(x)
// %COM Builder 实例
// %将数组的各元素加1
// %刘维
// %ll_wei_1980@sohu.com
// %2004.5.20
// y=x+1;
//
mclMline(7);
y = mwVa(x, "x") + 1;
mwValidateOutput(y, 1, nargout_, "y", "addarray");
mclMlineFunctionReturn()
return y;
mclMlineExitFunctionReturn();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -