atenuacion_fibra_simulink.c

来自「matlab在通信原理中的应用」· C语言 代码 · 共 457 行 · 第 1/2 页

C
457
字号
/*
 * MATLAB Compiler: 3.0
 * Date: Wed Apr 07 23:58:18 2004
 * 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" "-S" "-W" "simulink"
 * "-L" "C" "-t" "-T" "link:mex" "libmatlbmx.mlib" "atenuacion_fibra" 
 */

#ifndef MLF_V2
#define MLF_V2 1
#endif

#ifdef __cplusplus
extern "C" {
#endif

#define S_FUNCTION_NAME atenuacion_fibra

#include "libmatlb.h"
#include "mccsimulink.h"
#include "atenuacion_fibra.h"
#include "gcs.h"
#include "num2str.h"
#include "str2num.h"
#include "warndlg.h"

extern _mex_information _mex_info;

static mexFunctionTableEntry function_table[1]
  = { { "atenuacion_fibra", mlxAtenuacion_fibra, 1, 1,
        &_local_function_table_atenuacion_fibra } };

static _mexInitTermTableEntry init_term_table[1]
  = { { InitializeModule_atenuacion_fibra,
        TerminateModule_atenuacion_fibra } };

/*
 * The function "Mwarndlg" is the MATLAB callback version of the "warndlg"
 * function from file "c:\matlab6p5\toolbox\matlab\uitools\warndlg.m". It
 * performs a callback to MATLAB to run the "warndlg" function, and passes any
 * resulting output arguments back to its calling function.
 */
static mxArray * Mwarndlg(int nargout_,
                          mxArray * WarnString,
                          mxArray * DlgName,
                          mxArray * Replace) {
    mxArray * varargout = NULL;
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 1, &varargout, NULL),
      "warndlg",
      WarnString, DlgName, Replace, NULL);
    return varargout;
}

/*
 * The function "Mstr2num" is the MATLAB callback version of the "str2num"
 * function from file "c:\matlab6p5\toolbox\matlab\strfun\str2num.m". It
 * performs a callback to MATLAB to run the "str2num" function, and passes any
 * resulting output arguments back to its calling function.
 */
static mxArray * Mstr2num(mxArray * * ok, int nargout_, mxArray * s) {
    mxArray * x = NULL;
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 0, &x, ok, NULL), "str2num", s, NULL);
    return x;
}

/*
 * The function "Mnum2str" is the MATLAB callback version of the "num2str"
 * function from file "c:\matlab6p5\toolbox\matlab\strfun\num2str.m". It
 * performs a callback to MATLAB to run the "num2str" function, and passes any
 * resulting output arguments back to its calling function.
 */
static mxArray * Mnum2str(int nargout_, mxArray * x, mxArray * f) {
    mxArray * s = NULL;
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 0, &s, NULL), "num2str", x, f, NULL);
    return s;
}

/*
 * The function "Mgcs" is the MATLAB callback version of the "gcs" function
 * from file "c:\matlab6p5\toolbox\simulink\simulink\gcs.m". It performs a
 * callback to MATLAB to run the "gcs" function, and passes any resulting
 * output arguments back to its calling function.
 */
static mxArray * Mgcs(int nargout_) {
    mxArray * cursys = NULL;
    mclFevalCallMATLAB(mclNVarargout(nargout_, 0, &cursys, NULL), "gcs", NULL);
    return cursys;
}

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

/*
 * The function "mlfNWarndlg" contains the nargout interface for the "warndlg"
 * M-function from file "c:\matlab6p5\toolbox\matlab\uitools\warndlg.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 * mlfNWarndlg(int nargout,
                      mlfVarargoutList * varargout,
                      mxArray * WarnString,
                      mxArray * DlgName,
                      mxArray * Replace) {
    mlfEnterNewContext(0, 3, WarnString, DlgName, Replace);
    nargout += mclNargout(varargout);
    *mlfGetVarargoutCellPtr(varargout)
      = Mwarndlg(nargout, WarnString, DlgName, Replace);
    mlfRestorePreviousContext(0, 3, WarnString, DlgName, Replace);
    return mlfAssignOutputs(varargout);
}

/*
 * The function "mlfWarndlg" contains the normal interface for the "warndlg"
 * M-function from file "c:\matlab6p5\toolbox\matlab\uitools\warndlg.m" (lines
 * 0-0). This function processes any input arguments and passes them to the
 * implementation version of the function, appearing above.
 */
mxArray * mlfWarndlg(mlfVarargoutList * varargout,
                     mxArray * WarnString,
                     mxArray * DlgName,
                     mxArray * Replace) {
    int nargout = 0;
    mlfEnterNewContext(0, 3, WarnString, DlgName, Replace);
    nargout += mclNargout(varargout);
    *mlfGetVarargoutCellPtr(varargout)
      = Mwarndlg(nargout, WarnString, DlgName, Replace);
    mlfRestorePreviousContext(0, 3, WarnString, DlgName, Replace);
    return mlfAssignOutputs(varargout);
}

/*
 * The function "mlfVWarndlg" contains the void interface for the "warndlg"
 * M-function from file "c:\matlab6p5\toolbox\matlab\uitools\warndlg.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 mlfVWarndlg(mxArray * WarnString, mxArray * DlgName, mxArray * Replace) {
    mxArray * varargout = NULL;
    mlfEnterNewContext(0, 3, WarnString, DlgName, Replace);
    varargout = Mwarndlg(0, WarnString, DlgName, Replace);
    mlfRestorePreviousContext(0, 3, WarnString, DlgName, Replace);
    mxDestroyArray(varargout);
}

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

/*
 * The function "mlfStr2num" contains the normal interface for the "str2num"
 * M-function from file "c:\matlab6p5\toolbox\matlab\strfun\str2num.m" (lines
 * 0-0). This function processes any input arguments and passes them to the
 * implementation version of the function, appearing above.
 */
mxArray * mlfStr2num(mxArray * * ok, mxArray * s) {
    int nargout = 1;
    mxArray * x = NULL;
    mxArray * ok__ = NULL;
    mlfEnterNewContext(1, 1, ok, s);
    if (ok != NULL) {
        ++nargout;
    }
    x = Mstr2num(&ok__, nargout, s);
    mlfRestorePreviousContext(1, 1, ok, s);
    if (ok != NULL) {
        mclCopyOutputArg(ok, ok__);
    } else {
        mxDestroyArray(ok__);
    }
    return mlfReturnValue(x);
}

/*
 * The function "mlxStr2num" contains the feval interface for the "str2num"
 * M-function from file "c:\matlab6p5\toolbox\matlab\strfun\str2num.m" (lines
 * 0-0). The feval function calls the implementation version of str2num through
 * this function. This function processes any input arguments and passes them
 * to the implementation version of the function, appearing above.
 */
void mlxStr2num(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
    mxArray * mprhs[1];
    mxArray * mplhs[2];
    int i;
    if (nlhs > 2) {
        mlfError(

⌨️ 快捷键说明

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