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

📄 mix_inv.cpp

📁 自己写的一个vc与MATLAB混合编程的例子
💻 CPP
字号:
//
// MATLAB Compiler: 3.0
// Date: Wed May 18 13:43:23 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_inv" 
//
#include "mix_inv.hpp"
#include "libmatlbm.hpp"

void InitializeModule_mix_inv() {
}

void TerminateModule_mix_inv() {
}

static mwArray Mmix_inv(int nargout_, mwArray x);

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

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

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

//
// The function "Mmix_inv" is the implementation version of the "mix_inv"
// M-function from file "d:\matlab6p5\work\quest\mix_inv.m" (lines 1-5). 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_inv(x);
//
static mwArray Mmix_inv(int nargout_, mwArray x) {
    mwLocalFunctionTable save_local_function_table_
      = &_local_function_table_mix_inv;
    mwArray y = mwArray::UNDEFINED;
    //
    // y=inv(x);
    //
    y = inv(mwVa(x, "x"));
    mwValidateOutput(y, 1, nargout_, "y", "mix_inv");
    return y;
    //
    // 
    // 
    //
}

⌨️ 快捷键说明

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