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

📄 seqmodfree.c

📁 ASUFIT-Matlab-全局拟合程序
💻 C
📖 第 1 页 / 共 2 页
字号:
      &ans,
      mlfNSet(
        0,
        textBox,
        mxCreateString("string"),
        mlfHorzcat(mxCreateString("chisq = "), mlfNum2str(chisq, NULL), NULL),
        NULL));
    /*
     * drawnow;
     */
    mlfDrawnow(NULL);
    mclValidateOutputs("seqmodfree", 1, nargout_, &f);
    mxDestroyArray(a);
    mxDestroyArray(ans);
    mxDestroyArray(datatemp);
    mxDestroyArray(j);
    mxDestroyArray(shift);
    mxDestroyArray(sigma);
    mxDestroyArray(space);
    mxDestroyArray(tTemp);
    mxDestroyArray(taoFit);
    mxDestroyArray(z);
    /*
     * 
     */
    return f;
}

/*
 * The function "mlfSeqmodfree" contains the normal interface for the
 * "seqmodfree" M-function from file "C:\MATLABR11\asufit24\seqmodfree.m"
 * (lines 1-65). This function processes any input arguments and passes them to
 * the implementation version of the function, appearing above.
 */
mxArray * mlfSeqmodfree(mxArray * params) {
    int nargout = 1;
    mxArray * f = mclGetUninitializedArray();
    mlfEnterNewContext(0, 1, params);
    f = Mseqmodfree(nargout, params);
    mlfRestorePreviousContext(0, 1, params);
    return mlfReturnValue(f);
}

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

/*
 * The function "Mseqmodfree_coeff" is the implementation version of the
 * "seqmodfree/coeff" M-function from file "C:\MATLABR11\asufit24\seqmodfree.m"
 * (lines 65-76). 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 B=coeff(taoFit)
 */
static mxArray * Mseqmodfree_coeff(int nargout_, mxArray * taoFit) {
    mxArray * B = mclGetUninitializedArray();
    mxArray * i = mclGetUninitializedArray();
    mclForLoopIterator iterator_0;
    mclForLoopIterator iterator_1;
    mxArray * j = mclGetUninitializedArray();
    mclValidateInputs("seqmodfree/coeff", 1, &taoFit);
    /*
     * 
     * B=zeros(size(taoFit,2));
     */
    mlfAssign(
      &B, mlfZeros(mlfSize(mclValueVarargout(), taoFit, mlfScalar(2.0)), NULL));
    /*
     * B(1,1)=1;
     */
    mlfIndexAssign(&B, "(?,?)", mlfScalar(1.0), mlfScalar(1.0), mlfScalar(1.0));
    /*
     * if (size(taoFit,2)>=2)
     */
    if (mlfTobool(
          mlfGe(
            mlfSize(mclValueVarargout(), taoFit, mlfScalar(2.0)),
            mlfScalar(2.0)))) {
        /*
         * for i=2:length(taoFit)
         */
        for (mclForStart(&iterator_0, mlfScalar(2.0), mlfLength(taoFit), NULL);
             mclForNext(&iterator_0, &i);
             ) {
            /*
             * for j= 1:i
             */
            for (mclForStart(&iterator_1, mlfScalar(1.0), i, NULL);
                 mclForNext(&iterator_1, &j);
                 ) {
                /*
                 * B(i,j)=prod(taoFit(1:i-1))/prod(taoFit(find(taoFit(1:i)-taoFit(j)))-taoFit(j));
                 */
                mlfIndexAssign(
                  &B,
                  "(?,?)",
                  i,
                  j,
                  mlfMrdivide(
                    mlfProd(
                      mlfIndexRef(
                        taoFit,
                        "(?)",
                        mlfColon(
                          mlfScalar(1.0), mlfMinus(i, mlfScalar(1.0)), NULL)),
                      NULL),
                    mlfProd(
                      mlfMinus(
                        mlfIndexRef(
                          taoFit,
                          "(?)",
                          mlfFind(
                            NULL,
                            NULL,
                            mlfMinus(
                              mlfIndexRef(
                                taoFit,
                                "(?)",
                                mlfColon(mlfScalar(1.0), i, NULL)),
                              mlfIndexRef(taoFit, "(?)", j)))),
                        mlfIndexRef(taoFit, "(?)", j)),
                      NULL)));
            /*
             * end
             */
            }
        /*
         * end
         */
        }
    /*
     * end
     */
    }
    mclValidateOutputs("seqmodfree/coeff", 1, nargout_, &B);
    mxDestroyArray(i);
    mxDestroyArray(j);
    return B;
}

/*
 * The function "mlfSeqmodfree_coeff" contains the normal interface for the
 * "seqmodfree/coeff" M-function from file "C:\MATLABR11\asufit24\seqmodfree.m"
 * (lines 65-76). This function processes any input arguments and passes them
 * to the implementation version of the function, appearing above.
 */
static mxArray * mlfSeqmodfree_coeff(mxArray * taoFit) {
    int nargout = 1;
    mxArray * B = mclGetUninitializedArray();
    mlfEnterNewContext(0, 1, taoFit);
    B = Mseqmodfree_coeff(nargout, taoFit);
    mlfRestorePreviousContext(0, 1, taoFit);
    return mlfReturnValue(B);
}

/*
 * The function "mlxSeqmodfree_coeff" contains the feval interface for the
 * "seqmodfree/coeff" M-function from file "C:\MATLABR11\asufit24\seqmodfree.m"
 * (lines 65-76). The feval function calls the implementation version of
 * seqmodfree/coeff through this function. This function processes any input
 * arguments and passes them to the implementation version of the function,
 * appearing above.
 */
static void mlxSeqmodfree_coeff(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: seqmodfree/coeff Line: 65 Colu"
            "mn: 0 The function \"seqmodfree/coeff\" was called w"
            "ith more than the declared number of outputs (1)"));
    }
    if (nrhs > 1) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: seqmodfree/coeff Line: 65 Colu"
            "mn: 0 The function \"seqmodfree/coeff\" was called w"
            "ith more than the declared number of inputs (1)"));
    }
    for (i = 0; i < 1; ++i) {
        mplhs[i] = 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]);
    mplhs[0] = Mseqmodfree_coeff(nlhs, mprhs[0]);
    mlfRestorePreviousContext(0, 1, mprhs[0]);
    plhs[0] = mplhs[0];
}

⌨️ 快捷键说明

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