⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mix_eigvector.cpp

📁 自己写的一个vc与MATLAB混合编程的例子
💻 CPP
字号:
//
// MATLAB Compiler: 3.0
// Date: Wed May 18 13:57:07 2005
// 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" "-t" "-L" "Cpp"
// "mix_eigvector" 
//
#include "mix_eigvector.hpp"
#include "libmatlbm.hpp"

void InitializeModule_mix_eigvector() {
}

void TerminateModule_mix_eigvector() {
}

static mwArray Mmix_eigvector(int nargout_, mwArray x);

_mexLocalFunctionTable _local_function_table_mix_eigvector
  = { 0, (mexFunctionTableEntry *)NULL };

//
// The function "mix_eigvector" contains the normal interface for the
// "mix_eigvector" M-function from file
// "d:\matlab6p5\work\quest\mix_eigvector.m" (lines 1-2). This function
// processes any input arguments and passes them to the implementation version
// of the function, appearing above.
//
mwArray mix_eigvector(mwArray x) {
    int nargout = 1;
    mwArray y = mwArray::UNDEFINED;
    y = Mmix_eigvector(nargout, x);
    return y;
}

//
// The function "mlxMix_eigvector" contains the feval interface for the
// "mix_eigvector" M-function from file
// "d:\matlab6p5\work\quest\mix_eigvector.m" (lines 1-2). The feval function
// calls the implementation version of mix_eigvector through this function.
// This function processes any input arguments and passes them to the
// implementation version of the function, appearing above.
//
void mlxMix_eigvector(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: mix_eigvector Line: 1 Column"
                  ": 1 The function \"mix_eigvector\" was called with"
                  " more than the declared number of outputs (1).")));
        }
        if (nrhs > 1) {
            error(
              mwVarargin(
                mwArray(
                  "Run-time Error: File: mix_eigvector Line: 1 Column"
                  ": 1 The function \"mix_eigvector\" was called with"
                  " more 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] = Mmix_eigvector(nlhs, mprhs[0]);
        plhs[0] = mplhs[0].FreezeData();
    }
    MW_END_MLX();
}

//
// The function "Mmix_eigvector" is the implementation version of the
// "mix_eigvector" M-function from file
// "d:\matlab6p5\work\quest\mix_eigvector.m" (lines 1-2). 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=mix_eigvector(x);
//
static mwArray Mmix_eigvector(int nargout_, mwArray x) {
    mwLocalFunctionTable save_local_function_table_
      = &_local_function_table_mix_eigvector;
    mwArray y = mwArray::UNDEFINED;
    mwArray d = mwArray::UNDEFINED;
    //
    // [y,d] = eig(x);
    //
    y = eig(&d, mwVa(x, "x"));
    mwValidateOutput(y, 1, nargout_, "y", "mix_eigvector");
    return y;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -