📄 fcpp.cpp
字号:
//
// MATLAB Compiler: 2.2
// Date: Tue Jun 25 14:49:22 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" "-p" "-W" "main" "-L"
// "Cpp" "-t" "-T" "link:exe" "-h" "libmmfile.mlib" "fcpp"
//
#include "fcpp.hpp"
#include "SAA.hpp"
#include "libmatlbm.hpp"
#include "libmmfile.hpp"
static mxChar _array1_[126] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
'l', 'e', ':', ' ', 'f', 'c', 'p', 'p', ' ',
'L', 'i', 'n', 'e', ':', ' ', '1', ' ', 'C',
'o', 'l', 'u', 'm', 'n', ':', ' ', '1', ' ',
'T', 'h', 'e', ' ', 'f', 'u', 'n', 'c', 't',
'i', 'o', 'n', ' ', '"', 'f', 'c', 'p', 'p',
'"', ' ', '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 mwArray _mxarray0_ = mclInitializeString(126, _array1_);
static mxChar _array3_[125] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
'l', 'e', ':', ' ', 'f', 'c', 'p', 'p', ' ',
'L', 'i', 'n', 'e', ':', ' ', '1', ' ', 'C',
'o', 'l', 'u', 'm', 'n', ':', ' ', '1', ' ',
'T', 'h', 'e', ' ', 'f', 'u', 'n', 'c', 't',
'i', 'o', 'n', ' ', '"', 'f', 'c', 'p', 'p',
'"', ' ', '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 mwArray _mxarray2_ = mclInitializeString(125, _array3_);
static mxChar _array5_[3] = { 'S', 'A', 'A' };
static mwArray _mxarray4_ = mclInitializeString(3, _array5_);
static mwArray _mxarray6_ = mclInitializeDouble(1.0);
static mwArray _mxarray7_ = mclInitializeDouble(2.0);
static mxChar _array9_[22] = { 0xb6c0, 0xc1a2, 0xcde2, 0xb2bf, 0xb3cc, 0xd0f2,
' ', 'f', 'c', 'p', 'p', '.', 'e', 'x', 'e', ' ',
0xd4cb, 0xd0d0, 0xbde1, 0xb9fb, 0xcfd4, 0xcabe };
static mwArray _mxarray8_ = mclInitializeString(22, _array9_);
static mxChar _array11_[25] = { 's', 'i', 'n', '(', 'e', 'x', 'p', '(', '0',
'.', '6', 'x', ')', ')', '/', 'x', ' ', 0xbaaf,
0xcafd, 0xd4da, ' ', 'x', ' ', '=', ' ' };
static mwArray _mxarray10_ = mclInitializeString(25, _array11_);
static mxChar _array13_[14] = { ' ', 0xb8bd, 0xbdfc, 0xb4ef, 0xd7ee,
0xd0a1, 0xd6b5, 0xb5c4, 0xd7f8,
0xb1ea, 0xceaa, ' ', ' ', ' ' };
static mwArray _mxarray12_ = mclInitializeString(14, _array13_);
static mxChar _array15_[3] = { 0x0009, 0x0009, '(' };
static mwArray _mxarray14_ = mclInitializeString(3, _array15_);
static mxChar _array17_[1] = { ',' };
static mwArray _mxarray16_ = mclInitializeString(1, _array17_);
static mxChar _array19_[1] = { ')' };
static mwArray _mxarray18_ = mclInitializeString(1, _array19_);
void InitializeModule_fcpp() {
}
void TerminateModule_fcpp() {
}
static void Mfcpp(mwArray fun);
_mexLocalFunctionTable _local_function_table_fcpp
= { 0, (mexFunctionTableEntry *)NULL };
//
// The function "fcpp" contains the normal interface for the "fcpp" M-function
// from file "D:\mywork\fcpp.m" (lines 1-14). This function processes any input
// arguments and passes them to the implementation version of the function,
// appearing above.
//
void fcpp(mwArray fun) {
Mfcpp(fun);
}
//
// The function "mlxFcpp" contains the feval interface for the "fcpp"
// M-function from file "D:\mywork\fcpp.m" (lines 1-14). The feval function
// calls the implementation version of fcpp through this function. This
// function processes any input arguments and passes them to the implementation
// version of the function, appearing above.
//
void mlxFcpp(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
MW_BEGIN_MLX();
{
mwArray mprhs[1];
int i;
if (nlhs > 0) {
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();
}
Mfcpp(mprhs[0]);
}
MW_END_MLX();
}
//
// The function "Mfcpp" is the implementation version of the "fcpp" M-function
// from file "D:\mywork\fcpp.m" (lines 1-14). 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 fcpp(fun)
//
static void Mfcpp(mwArray fun) {
mwLocalFunctionTable save_local_function_table_
(&_local_function_table_fcpp);
mwArray ss(mclGetUninitializedArray());
mwArray ans(mclGetUninitializedArray());
mwArray y(mclGetUninitializedArray());
mwArray x(mclGetUninitializedArray());
mwArray xs(mclGetUninitializedArray());
//
// %#function SAA
// fun='SAA';
//
fun = _mxarray4_;
//
// xs=1;
//
xs = _mxarray6_;
//
// x=fminsearch(fun,xs);
//
x = Nfminsearch(1, NULL, NULL, NULL, mwVa(fun, "fun"), mwVv(xs, "xs"));
//
// y=feval(fun,x);
//
y = feval(mwValueVarargout(), mwVarargin(mwVa(fun, "fun"), mwVv(x, "x")));
//
// disp(blanks(2)')
//
disp(ctranspose(mwVe(blanks(_mxarray7_))));
//
// disp('独立外部程序 fcpp.exe 运行结果显示')
//
disp(_mxarray8_);
//
// disp(blanks(2)')
//
disp(ctranspose(mwVe(blanks(_mxarray7_))));
//
// ss=['sin(exp(0.6x))/x 函数在 x = ' num2str(xs) ' 附近达最小值的坐标为 '];
//
ss
= horzcat(
mwVarargin(_mxarray10_, mwVe(num2str(mwVv(xs, "xs"))), _mxarray12_));
//
// disp(ss);
//
disp(mwVv(ss, "ss"));
//
// disp(blanks(1)');
//
disp(ctranspose(mwVe(blanks(_mxarray6_))));
//
// disp([' (' num2str(x) ',' num2str(y) ')'])
//
disp(
horzcat(
mwVarargin(
_mxarray14_,
mwVe(num2str(mwVv(x, "x"))),
_mxarray16_,
mwVe(num2str(mwVv(y, "y"))),
_mxarray18_)));
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -