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

📄 adptive_bitpow_allocate_systems_mex.c

📁 好东西
💻 C
📖 第 1 页 / 共 3 页
字号:
    }
    for (i = 0; i < 1; ++i) {
        mplhs[i] = 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]);
    mplhs[0] = Minsert_cp(nlhs, mprhs[0], mprhs[1]);
    mlfRestorePreviousContext(0, 2, mprhs[0], mprhs[1]);
    plhs[0] = mplhs[0];
}

/*
 * The function "mlfHold" contains the normal interface for the "hold"
 * M-function from file "c:\matlab6p5\toolbox\matlab\graphics\hold.m" (lines
 * 0-0). This function processes any input arguments and passes them to the
 * implementation version of the function, appearing above.
 */
void mlfHold(mxArray * opt_hold_state) {
    mlfEnterNewContext(0, 1, opt_hold_state);
    Mhold(opt_hold_state);
    mlfRestorePreviousContext(0, 1, opt_hold_state);
}

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

/*
 * The function "mlfEtime" contains the normal interface for the "etime"
 * M-function from file "c:\matlab6p5\toolbox\matlab\timefun\etime.m" (lines
 * 0-0). This function processes any input arguments and passes them to the
 * implementation version of the function, appearing above.
 */
mxArray * mlfEtime(mxArray * t1, mxArray * t0) {
    int nargout = 1;
    mxArray * t = NULL;
    mlfEnterNewContext(0, 2, t1, t0);
    t = Metime(nargout, t1, t0);
    mlfRestorePreviousContext(0, 2, t1, t0);
    return mlfReturnValue(t);
}

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

/*
 * The function "mlfDe_map_module_adp" contains the normal interface for the
 * "de_map_module_adp" M-function from file
 * "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\de_map_module_adp.m" (lines
 * 0-0). This function processes any input arguments and passes them to the
 * implementation version of the function, appearing above.
 */
mxArray * mlfDe_map_module_adp(mxArray * input,
                               mxArray * map_flag,
                               mxArray * groupsize,
                               mxArray * groupnumber,
                               mxArray * bit_num_ofdmsig) {
    int nargout = 1;
    mxArray * output = NULL;
    mlfEnterNewContext(
      0, 5, input, map_flag, groupsize, groupnumber, bit_num_ofdmsig);
    output
      = Mde_map_module_adp(
          nargout, input, map_flag, groupsize, groupnumber, bit_num_ofdmsig);
    mlfRestorePreviousContext(
      0, 5, input, map_flag, groupsize, groupnumber, bit_num_ofdmsig);
    return mlfReturnValue(output);
}

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

/*
 * The function "mlfCut_cp" contains the normal interface for the "cut_cp"
 * M-function from file "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\cut_cp.m"
 * (lines 0-0). This function processes any input arguments and passes them to
 * the implementation version of the function, appearing above.
 */
mxArray * mlfCut_cp(mxArray * input, mxArray * cp_length) {
    int nargout = 1;
    mxArray * output = NULL;
    mlfEnterNewContext(0, 2, input, cp_length);
    output = Mcut_cp(nargout, input, cp_length);
    mlfRestorePreviousContext(0, 2, input, cp_length);
    return mlfReturnValue(output);
}

/*
 * The function "mlxCut_cp" contains the feval interface for the "cut_cp"
 * M-function from file "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\cut_cp.m"
 * (lines 0-0). The feval function calls the implementation version of cut_cp
 * through this function. This function processes any input arguments and
 * passes them to the implementation version of the function, appearing above.
 */
void mlxCut_cp(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
    mxArray * mprhs[2];
    mxArray * mplhs[1];
    int i;
    if (nlhs > 1) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: cut_cp Line: 1 Column: "
            "1 The function \"cut_cp\" was called with mor"
            "e than the declared number of outputs (1)."),
          NULL);
    }
    if (nrhs > 2) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: cut_cp Line: 1 Column: "
            "1 The function \"cut_cp\" was called with mor"
            "e than the declared number of inputs (2)."),
          NULL);
    }
    for (i = 0; i < 1; ++i) {
        mplhs[i] = 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]);
    mplhs[0] = Mcut_cp(nlhs, mprhs[0], mprhs[1]);
    mlfRestorePreviousContext(0, 2, mprhs[0], mprhs[1]);
    plhs[0] = mplhs[0];
}

/*
 * The function "mlfBitandpoweralloct2" contains the normal interface for the
 * "bitandpoweralloct2" M-function from file
 * "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\bitandpoweralloct2.m" (lines
 * 0-0). This function processes any input arguments and passes them to the
 * implementation version of the function, appearing above.
 */
mxArray * mlfBitandpoweralloct2(mxArray * * Cbitvector,
                                mxArray * * gama,
                                mxArray * N_carrier,
                                mxArray * groupnumber,
                                mxArray * Hk,
                                mxArray * SNR,
                                mxArray * Pe,
                                mxArray * N_ofdm) {
    int nargout = 1;
    mxArray * poweralloctvector = NULL;
    mxArray * Cbitvector__ = NULL;
    mxArray * gama__ = NULL;
    mlfEnterNewContext(
      2, 6, Cbitvector, gama, N_carrier, groupnumber, Hk, SNR, Pe, N_ofdm);
    if (Cbitvector != NULL) {
        ++nargout;
    }
    if (gama != NULL) {
        ++nargout;
    }
    poweralloctvector
      = Mbitandpoweralloct2(
          &Cbitvector__,
          &gama__,
          nargout,
          N_carrier,
          groupnumber,
          Hk,
          SNR,
          Pe,
          N_ofdm);
    mlfRestorePreviousContext(
      2, 6, Cbitvector, gama, N_carrier, groupnumber, Hk, SNR, Pe, N_ofdm);
    if (Cbitvector != NULL) {
        mclCopyOutputArg(Cbitvector, Cbitvector__);
    } else {
        mxDestroyArray(Cbitvector__);
    }
    if (gama != NULL) {
        mclCopyOutputArg(gama, gama__);
    } else {
        mxDestroyArray(gama__);
    }
    return mlfReturnValue(poweralloctvector);
}

/*
 * The function "mlxBitandpoweralloct2" contains the feval interface for the
 * "bitandpoweralloct2" M-function from file
 * "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\bitandpoweralloct2.m" (lines
 * 0-0). The feval function calls the implementation version of
 * bitandpoweralloct2 through this function. This function processes any input
 * arguments and passes them to the implementation version of the function,
 * appearing above.
 */
void mlxBitandpoweralloct2(int nlhs,
                           mxArray * plhs[],
                           int nrhs,
                           mxArray * prhs[]) {
    mxArray * mprhs[6];
    mxArray * mplhs[3];
    int i;
    if (nlhs > 3) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: bitandpoweralloct2 Line: 1 Colu"
            "mn: 1 The function \"bitandpoweralloct2\" was called "
            "with more than the declared number of outputs (3)."),
          NULL);
    }
    if (nrhs > 6) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: bitandpoweralloct2 Line: 1 Colu"
            "mn: 1 The function \"bitandpoweralloct2\" was called "
            "with more than the declared number of inputs (6)."),
          NULL);
    }
    for (i = 0; i < 3; ++i) {
        mplhs[i] = NULL;
    }
    for (i = 0; i < 6 && i < nrhs; ++i) {
        mprhs[i] = prhs[i];
    }
    for (; i < 6; ++i) {
        mprhs[i] = NULL;
    }
    mlfEnterNewContext(
      0, 6, mprhs[0], mprhs[1], mprhs[2], mprhs[3], mprhs[4], mprhs[5]);
    mplhs[0]
      = Mbitandpoweralloct2(
          &mplhs[1],
          &mplhs[2],
          nlhs,
          mprhs[0],
          mprhs[1],
          mprhs[2],
          mprhs[3],
          mprhs[4],
          mprhs[5]);
    mlfRestorePreviousContext(
      0, 6, mprhs[0], mprhs[1], mprhs[2], mprhs[3], mprhs[4], mprhs[5]);
    plhs[0] = mplhs[0];
    for (i = 1; i < 3 && i < nlhs; ++i) {
        plhs[i] = mplhs[i];
    }
    for (; i < 3; ++i) {
        mxDestroyArray(mplhs[i]);
    }
}

/*
 * The function "mlfAdd_noise" contains the normal interface for the
 * "add_noise" M-function from file
 * "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\add_noise.m" (lines 0-0). This
 * function processes any input arguments and passes them to the implementation
 * version of the function, appearing above.
 */
mxArray * mlfAdd_noise(mxArray * sgma, mxArray * input) {
    int nargout = 1;
    mxArray * output = NULL;
    mlfEnterNewContext(0, 2, sgma, input);
    output = Madd_noise(nargout, sgma, input);
    mlfRestorePreviousContext(0, 2, sgma, input);
    return mlfReturnValue(output);
}

/*
 * The function "mlxAdd_noise" contains the feval interface for the "add_noise"
 * M-function from file
 * "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\add_noise.m" (lines 0-0). The
 * feval function calls the implementation version of add_noise through this
 * function. This function processes any input arguments and passes them to the
 * implementation version of the function, appearing above.
 */
void mlxAdd_noise(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
    mxArray * mprhs[2];
    mxArray * mplhs[1];
    int i;
    if (nlhs > 1) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: add_noise Line: 1 Column:"
            " 1 The function \"add_noise\" was called with m"
            "ore than the declared number of outputs (1)."),
          NULL);
    }
    if (nrhs > 2) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: add_noise Line: 1 Column:"
            " 1 The function \"add_noise\" was called with m"
            "ore than the declared number of inputs (2)."),
          NULL);
    }
    for (i = 0; i < 1; ++i) {
        mplhs[i] = 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]);
    mplhs[0] = Madd_noise(nlhs, mprhs[0], mprhs[1]);
    mlfRestorePreviousContext(0, 2, mprhs[0], mprhs[1]);
    plhs[0] = mplhs[0];
}

⌨️ 快捷键说明

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