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

📄 sjbh1_mex.c

📁 其中包括了matlab中最基本的算法院程序
💻 C
📖 第 1 页 / 共 2 页
字号:
 * 0-0). The feval function calls the implementation version of legend through
 * this function. This function processes any input arguments and passes them
 * to the implementation version of the function, appearing above.
 */
void mlxLegend(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
    mxArray * mprhs[1];
    mxArray * mplhs[4];
    int i;
    if (nlhs > 4) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: legend Line: 1 Column: "
            "1 The function \"legend\" was called with mor"
            "e than the declared number of outputs (4)."),
          NULL);
    }
    for (i = 0; i < 4; ++i) {
        mplhs[i] = NULL;
    }
    mlfEnterNewContext(0, 0);
    mprhs[0] = NULL;
    mlfAssign(&mprhs[0], mclCreateVararginCell(nrhs, prhs));
    mplhs[0] = Mlegend(&mplhs[1], &mplhs[2], &mplhs[3], nlhs, mprhs[0]);
    mlfRestorePreviousContext(0, 0);
    plhs[0] = mplhs[0];
    for (i = 1; i < 4 && i < nlhs; ++i) {
        plhs[i] = mplhs[i];
    }
    for (; i < 4; ++i) {
        mxDestroyArray(mplhs[i]);
    }
    mxDestroyArray(mprhs[0]);
}

/*
 * The function "mlfGrid" contains the normal interface for the "grid"
 * M-function from file "d:\matlab6p5p1\toolbox\matlab\graph2d\grid.m" (lines
 * 0-0). This function processes any input arguments and passes them to the
 * implementation version of the function, appearing above.
 */
void mlfGrid(mxArray * arg1, mxArray * arg2) {
    mlfEnterNewContext(0, 2, arg1, arg2);
    Mgrid(arg1, arg2);
    mlfRestorePreviousContext(0, 2, arg1, arg2);
}

/*
 * The function "mlxGrid" contains the feval interface for the "grid"
 * M-function from file "d:\matlab6p5p1\toolbox\matlab\graph2d\grid.m" (lines
 * 0-0). The feval function calls the implementation version of grid through
 * this function. This function processes any input arguments and passes them
 * to the implementation version of the function, appearing above.
 */
void mlxGrid(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
    mxArray * mprhs[2];
    int i;
    if (nlhs > 0) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: grid Line: 1 Column: 1 The function \"grid\""
            " was called with more than the declared number of outputs (0)."),
          NULL);
    }
    if (nrhs > 2) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: grid Line: 1 Column: 1 The function \"grid"
            "\" was called with more than the declared number of inputs (2)."),
          NULL);
    }
    for (i = 0; i < 2 && i < nrhs; ++i) {
        mprhs[i] = prhs[i];
    }
    for (; i < 2; ++i) {
        mprhs[i] = NULL;
    }
    mlfEnterNewContext(0, 2, mprhs[0], mprhs[1]);
    Mgrid(mprhs[0], mprhs[1]);
    mlfRestorePreviousContext(0, 2, mprhs[0], mprhs[1]);
}

/*
 * The function "mlfNAxis" contains the nargout interface for the "axis"
 * M-function from file "d:\matlab6p5p1\toolbox\matlab\graph2d\axis.m" (lines
 * 0-0). This interface is only produced if the M-function uses the special
 * variable "nargout". The nargout interface allows the number of requested
 * outputs to be specified via the nargout argument, as opposed to the normal
 * interface which dynamically calculates the number of outputs based on the
 * number of non-NULL inputs it receives. This function processes any input
 * arguments and passes them to the implementation version of the function,
 * appearing above.
 */
mxArray * mlfNAxis(int nargout, mxArray * * ans2, mxArray * * ans3, ...) {
    mxArray * varargin = NULL;
    mxArray * ans1 = NULL;
    mxArray * ans2__ = NULL;
    mxArray * ans3__ = NULL;
    mlfVarargin(&varargin, ans3, 0);
    mlfEnterNewContext(2, -1, ans2, ans3, varargin);
    ans1 = Maxis(&ans2__, &ans3__, nargout, varargin);
    mlfRestorePreviousContext(2, 0, ans2, ans3);
    mxDestroyArray(varargin);
    if (ans2 != NULL) {
        mclCopyOutputArg(ans2, ans2__);
    } else {
        mxDestroyArray(ans2__);
    }
    if (ans3 != NULL) {
        mclCopyOutputArg(ans3, ans3__);
    } else {
        mxDestroyArray(ans3__);
    }
    return mlfReturnValue(ans1);
}

/*
 * The function "mlfAxis" contains the normal interface for the "axis"
 * M-function from file "d:\matlab6p5p1\toolbox\matlab\graph2d\axis.m" (lines
 * 0-0). This function processes any input arguments and passes them to the
 * implementation version of the function, appearing above.
 */
mxArray * mlfAxis(mxArray * * ans2, mxArray * * ans3, ...) {
    mxArray * varargin = NULL;
    int nargout = 1;
    mxArray * ans1 = NULL;
    mxArray * ans2__ = NULL;
    mxArray * ans3__ = NULL;
    mlfVarargin(&varargin, ans3, 0);
    mlfEnterNewContext(2, -1, ans2, ans3, varargin);
    if (ans2 != NULL) {
        ++nargout;
    }
    if (ans3 != NULL) {
        ++nargout;
    }
    ans1 = Maxis(&ans2__, &ans3__, nargout, varargin);
    mlfRestorePreviousContext(2, 0, ans2, ans3);
    mxDestroyArray(varargin);
    if (ans2 != NULL) {
        mclCopyOutputArg(ans2, ans2__);
    } else {
        mxDestroyArray(ans2__);
    }
    if (ans3 != NULL) {
        mclCopyOutputArg(ans3, ans3__);
    } else {
        mxDestroyArray(ans3__);
    }
    return mlfReturnValue(ans1);
}

/*
 * The function "mlfVAxis" contains the void interface for the "axis"
 * M-function from file "d:\matlab6p5p1\toolbox\matlab\graph2d\axis.m" (lines
 * 0-0). The void interface is only produced if the M-function uses the special
 * variable "nargout", and has at least one output. The void interface function
 * specifies zero output arguments to the implementation version of the
 * function, and in the event that the implementation version still returns an
 * output (which, in MATLAB, would be assigned to the "ans" variable), it
 * deallocates the output. This function processes any input arguments and
 * passes them to the implementation version of the function, appearing above.
 */
void mlfVAxis(mxArray * synthetic_varargin_argument, ...) {
    mxArray * varargin = NULL;
    mxArray * ans1 = NULL;
    mxArray * ans2 = NULL;
    mxArray * ans3 = NULL;
    mlfVarargin(&varargin, synthetic_varargin_argument, 1);
    mlfEnterNewContext(0, -1, varargin);
    ans1 = Maxis(&ans2, &ans3, 0, synthetic_varargin_argument);
    mlfRestorePreviousContext(0, 0);
    mxDestroyArray(varargin);
    mxDestroyArray(ans1);
    mxDestroyArray(ans2);
}

/*
 * The function "mlxAxis" contains the feval interface for the "axis"
 * M-function from file "d:\matlab6p5p1\toolbox\matlab\graph2d\axis.m" (lines
 * 0-0). The feval function calls the implementation version of axis through
 * this function. This function processes any input arguments and passes them
 * to the implementation version of the function, appearing above.
 */
void mlxAxis(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
    mxArray * mprhs[1];
    mxArray * mplhs[3];
    int i;
    if (nlhs > 3) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: axis Line: 1 Column: 1 The function \"axis\""
            " was called with more than the declared number of outputs (3)."),
          NULL);
    }
    for (i = 0; i < 3; ++i) {
        mplhs[i] = NULL;
    }
    mlfEnterNewContext(0, 0);
    mprhs[0] = NULL;
    mlfAssign(&mprhs[0], mclCreateVararginCell(nrhs, prhs));
    mplhs[0] = Maxis(&mplhs[1], &mplhs[2], nlhs, mprhs[0]);
    mlfRestorePreviousContext(0, 0);
    plhs[0] = mplhs[0];
    for (i = 1; i < 3 && i < nlhs; ++i) {
        plhs[i] = mplhs[i];
    }
    for (; i < 3; ++i) {
        mxDestroyArray(mplhs[i]);
    }
    mxDestroyArray(mprhs[0]);
}

⌨️ 快捷键说明

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