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

📄 test.c

📁 该程序为MATLAB对CDMA系统个部分的仿真
💻 C
字号:
/*
 * MATLAB Compiler: 2.2
 * Date: Tue Jun 25 10:49:28 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" "-O" "none" "-O"
 * "fold_scalar_mxarrays:off" "-O" "fold_non_scalar_mxarrays:off" "-O"
 * "optimize_integer_for_loops:off" "-O" "array_indexing:off" "-O"
 * "optimize_conditionals:off" "-x" "-W" "mex" "-L" "C" "-t" "-T"
 * "link:mexlibrary" "libmatlbmx.mlib" "test" 
 */
#include "test.h"
#include "libmatlbm.h"

static double _array0_[4] = { 1.0, 0.0, 0.0, 1.0 };

static double _array1_[4] = { 3.141592653589793, -3.141592653589793,
                              1.5707963267948966, -1.5707963267948966 };

void InitializeModule_test(void) {
}

void TerminateModule_test(void) {
}

static mxArray * Mtest(int nargout_);

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

/*
 * The function "mlfTest" contains the normal interface for the "test"
 * M-function from file "D:\mywork\test.m" (lines 1-3). This function processes
 * any input arguments and passes them to the implementation version of the
 * function, appearing above.
 */
mxArray * mlfTest(void) {
    int nargout = 1;
    mxArray * y = mclGetUninitializedArray();
    mlfEnterNewContext(0, 0);
    y = Mtest(nargout);
    mlfRestorePreviousContext(0, 0);
    return mlfReturnValue(y);
}

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

/*
 * The function "Mtest" is the implementation version of the "test" M-function
 * from file "D:\mywork\test.m" (lines 1-3). 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 = test
 */
static mxArray * Mtest(int nargout_) {
    mexLocalFunctionTable save_local_function_table_
      = mclSetCurrentLocalFunctionTable(&_local_function_table_test);
    mxArray * y = mclGetUninitializedArray();
    /*
     * y = [ 1 0; 0 1] * [ pi pi/2; -pi -pi/2 ];
     */
    mlfAssign(
      &y,
      mclMtimes(
        mlfDoubleMatrix(2, 2, _array0_, (double *)NULL),
        mlfDoubleMatrix(2, 2, _array1_, (double *)NULL)));
    mclValidateOutput(y, 1, nargout_, "y", "test");
    mclSetCurrentLocalFunctionTable(save_local_function_table_);
    return y;
}

⌨️ 快捷键说明

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