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

📄 circle_f_mex.c

📁 该程序为MATLAB对CDMA系统个部分的仿真
💻 C
字号:
/*
 * MATLAB Compiler: 2.2
 * Date: Tue Jun 25 12:26:00 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" "-x" "-W" "mex" "-L" "C"
 * "-t" "-T" "link:mexlibrary" "libmatlbmx.mlib" "circle_f" 
 */

#ifndef MLF_V2
#define MLF_V2 1
#endif

#include "libmatlb.h"
#include "circle_f.h"
#include "axis.h"
#include "clf.h"

static mexFunctionTableEntry function_table[1]
  = { { "circle_f", mlxCircle_f, 1, 0, &_local_function_table_circle_f } };

static _mexInitTermTableEntry init_term_table[1]
  = { { InitializeModule_circle_f, TerminateModule_circle_f } };

static _mex_information _mex_info
  = { 1, 1, function_table, 0, NULL, 0, NULL, 1, init_term_table };

/*
 * The function "Mclf" is the MATLAB callback version of the "clf" function
 * from file "d:\MATLAB6p1\toolbox\matlab\graphics\clf.m". It performs a
 * callback to MATLAB to run the "clf" function, and passes any resulting
 * output arguments back to its calling function.
 */
static mxArray * Mclf(int nargout_, mxArray * varargin) {
    mxArray * ret_fig = mclGetUninitializedArray();
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 0, &ret_fig, NULL),
      "clf",
      mlfIndexRef(varargin, "{?}", mlfCreateColonIndex()), NULL);
    return ret_fig;
}

/*
 * The function "Maxis" is the MATLAB callback version of the "axis" function
 * from file "d:\MATLAB6p1\toolbox\matlab\graph2d\axis.m". It performs a
 * callback to MATLAB to run the "axis" function, and passes any resulting
 * output arguments back to its calling function.
 */
static mxArray * Maxis(mxArray * * ans2,
                       mxArray * * ans3,
                       int nargout_,
                       mxArray * varargin) {
    mxArray * ans1 = mclGetUninitializedArray();
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 0, &ans1, ans2, ans3, NULL),
      "axis",
      mlfIndexRef(varargin, "{?}", mlfCreateColonIndex()), NULL);
    return ans1;
}

/*
 * The function "mexLibrary" is a Compiler-generated mex wrapper, suitable for
 * building a MEX-function. It initializes any persistent variables as well as
 * a function table for use by the feval function. It then calls the function
 * "mlxCircle_f". Finally, it clears the feval table and exits.
 */
mex_information mexLibrary(void) {
    mclMexLibraryInit();
    return &_mex_info;
}

/*
 * The function "mlfNClf" contains the nargout interface for the "clf"
 * M-function from file "d:\MATLAB6p1\toolbox\matlab\graphics\clf.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 * mlfNClf(int nargout, ...) {
    mxArray * varargin = NULL;
    mxArray * ret_fig = mclGetUninitializedArray();
    mlfVarargin(&varargin, nargout, 0);
    mlfEnterNewContext(0, -1, varargin);
    ret_fig = Mclf(nargout, varargin);
    mlfRestorePreviousContext(0, 0);
    mxDestroyArray(varargin);
    return mlfReturnValue(ret_fig);
}

/*
 * The function "mlfClf" contains the normal interface for the "clf" M-function
 * from file "d:\MATLAB6p1\toolbox\matlab\graphics\clf.m" (lines 0-0). This
 * function processes any input arguments and passes them to the implementation
 * version of the function, appearing above.
 */
mxArray * mlfClf(mxArray * synthetic_varargin_argument, ...) {
    mxArray * varargin = NULL;
    int nargout = 1;
    mxArray * ret_fig = mclGetUninitializedArray();
    mlfVarargin(&varargin, synthetic_varargin_argument, 1);
    mlfEnterNewContext(0, -1, varargin);
    ret_fig = Mclf(nargout, varargin);
    mlfRestorePreviousContext(0, 0);
    mxDestroyArray(varargin);
    return mlfReturnValue(ret_fig);
}

/*
 * The function "mlfVClf" contains the void interface for the "clf" M-function
 * from file "d:\MATLAB6p1\toolbox\matlab\graphics\clf.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 mlfVClf(mxArray * synthetic_varargin_argument, ...) {
    mxArray * varargin = NULL;
    mxArray * ret_fig = NULL;
    mlfVarargin(&varargin, synthetic_varargin_argument, 1);
    mlfEnterNewContext(0, -1, varargin);
    ret_fig = Mclf(0, synthetic_varargin_argument);
    mlfRestorePreviousContext(0, 0);
    mxDestroyArray(varargin);
}

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

/*
 * The function "mlfAxis" contains the normal interface for the "axis"
 * M-function from file "d:\MATLAB6p1\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 = mclGetUninitializedArray();
    mxArray * ans2__ = mclGetUninitializedArray();
    mxArray * ans3__ = mclGetUninitializedArray();
    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 "mlxAxis" contains the feval interface for the "axis"
 * M-function from file "d:\MATLAB6p1\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)."));
    }
    for (i = 0; i < 3; ++i) {
        mplhs[i] = mclGetUninitializedArray();
    }
    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 + -