亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sfun_eso.c

?? 內涵大量基于MATLAB的仿真算法
?? C
字號:

/*
 * sfuntmpl_basic.c: Basic 'C' template for a level 2 S-function.
 *
 *  -------------------------------------------------------------------------
 *  | See matlabroot/simulink/src/sfuntmpl_doc.c for a more detailed template |
 *  -------------------------------------------------------------------------
 *
 * Copyright 1990-2001 The MathWorks, Inc.
 * $Revision: 1.26 $
 */


/*
 * You must specify the S_FUNCTION_NAME as the name of your S-function
 * (i.e. replace sfuntmpl_basic with the name of your S-function).
 */

#define S_FUNCTION_NAME  sfun_eso
#define S_FUNCTION_LEVEL 2

/*
 * Need to include simstruc.h for the definition of the SimStruct and
 * its associated macro definitions.
 */
#include "simstruc.h"
#include "math.h"

/* Error handling
 * --------------
 *
 * You should use the following technique to report errors encountered within
 * an S-function:
 *
 *       ssSetErrorStatus(S,"Error encountered due to ...");
 *       return;
 *
 * Note that the 2nd argument to ssSetErrorStatus must be persistent memory.
 * It cannot be a local variable. For example the following will cause
 * unpredictable errors:
 *
 *      mdlOutputs()
 *      {
 *         char msg[256];         {ILLEGAL: to fix use "static char msg[256];"}
 *         sprintf(msg,"Error due to %s", string);
 *         ssSetErrorStatus(S,msg);
 *         return;
 *      }
 *
 * See matlabroot/simulink/src/sfuntmpl_doc.c for more details.
 */

 double sign(double x)
{
   double f;
   f=1; if (x<=0) f=-1; return(f);
}

double fal(double e, double a, const real_T *p1)
{
   double d;
   d=p1[0];
   if (fabs(e)<=d) return(e*pow(a,d));
   else return(pow(fabs(e),a)*sign(e));
}

/*====================*
 * S-function methods *
 *====================*/

/* Function: mdlInitializeSizes ===============================================
 * Abstract:
 *    The sizes information is used by Simulink to determine the S-function
 *    block's characteristics (number of inputs, outputs, states, etc.).
 */
static void mdlInitializeSizes(SimStruct *S)
{
    /* See sfuntmpl_doc.c for more details on the macros below */

    ssSetNumSFcnParams(S, 4);  /* number of extra parameters */
    if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {
        /* Return if number of expected != number of actual parameters */
        return;
    }

    ssSetNumContStates(S, 0);
    ssSetNumDiscStates(S, 3);

    if (!ssSetNumInputPorts(S, 1)) return;
    ssSetInputPortWidth(S, 0, 2);
    ssSetInputPortRequiredContiguous(S, 0, true); /*direct input signal access*/
    /*
     * Set direct feedthrough flag (1=yes, 0=no).
     * A port has direct feedthrough if the input is used in either
     * the mdlOutputs or mdlGetTimeOfNextVarHit functions.
     * See matlabroot/simulink/src/sfuntmpl_directfeed.txt.
     */
    ssSetInputPortDirectFeedThrough(S, 0, 0);

    if (!ssSetNumOutputPorts(S, 1)) return;
    ssSetOutputPortWidth(S, 0, 3);

    ssSetNumSampleTimes(S, 1);
    ssSetNumRWork(S, 4);
    ssSetNumIWork(S, 0);
    ssSetNumPWork(S, 0);
    ssSetNumModes(S, 0);
    ssSetNumNonsampledZCs(S, 0);

    ssSetOptions(S, 0);
}

/* Function: mdlInitializeSampleTimes =========================================
 * Abstract:
 *    This function is used to specify the sample time(s) for your
 *    S-function. You must register the same number of sample times as
 *    specified in ssSetNumSampleTimes.
 */
static void mdlInitializeSampleTimes(SimStruct *S)
{
    ssSetSampleTime(S, 0, *mxGetPr(ssGetSFcnParam(S,3)));
    ssSetOffsetTime(S, 0, 0.0);
}

#define MDL_INITIALIZE_CONDITIONS   /* Change to #undef to remove function */
#if defined(MDL_INITIALIZE_CONDITIONS)
  /* Function: mdlInitializeConditions ========================================
   * Abstract:
   *    In this function, you should initialize the continuous and discrete
   *    states for your S-function block.  The initial states are placed
   *    in the state vector, ssGetContStates(S) or ssGetRealDiscStates(S).
   *    You can also perform any other initialization activities that your
   *    S-function may require. Note, this routine will be called at the
   *    start of simulation and if it is present in an enabled subsystem
   *    configured to reset states, it will be call when the enabled subsystem
   *    restarts execution to reset the states.
   */
  static void mdlInitializeConditions(SimStruct *S)
  {
  }
#endif /* MDL_INITIALIZE_CONDITIONS */

#define MDL_START  /* Change to #undef to remove function */
#if defined(MDL_START) 
  /* Function: mdlStart =======================================================
   * Abstract:
   *    This function is called once at start of model execution. If you
   *    have states that should be initialized once, this is the place
   *    to do it.
   */
  static void mdlStart(SimStruct *S)
  {
  }
#endif /*  MDL_START */

/* Function: mdlOutputs =======================================================
 * Abstract:
 *    In this function, you compute the outputs of your S-function
 *    block. Generally outputs are placed in the output vector, ssGetY(S).
 */
static void mdlOutputs(SimStruct *S, int_T tid)
{
    const real_T *x = ssGetRealDiscStates(S);
    real_T       *y = ssGetOutputPortSignal(S,0);
    y[0] = x[0];
    y[1] = x[1];
    y[2] = x[2];
}

#define MDL_UPDATE  /* Change to #undef to remove function */
#if defined(MDL_UPDATE)
  /* Function: mdlUpdate ======================================================
   * Abstract:
   *    This function is called once for every major integration time step.
   *    Discrete states are typically updated here, but this function is useful
   *    for performing any tasks that should only take place once per
   *    integration step.
   */
  static void mdlUpdate(SimStruct *S, int_T tid)
  {
    real_T       *x = ssGetRealDiscStates(S);
    const real_T *u = (const real_T*) ssGetInputPortSignal(S,0);
    const real_T *d = mxGetPr(ssGetSFcnParam(S,0));
    const real_T *bet = mxGetPr(ssGetSFcnParam(S,1));
    const real_T *b = mxGetPr(ssGetSFcnParam(S,2));
    const real_T *T = mxGetPr(ssGetSFcnParam(S,3));
    real_T tempX[3] = {0.0, 0.0, 0.0};
    double e;
    e = x[0]-u[1];
    tempX[0] = x[0] + T[0]*(x[1]-bet[0]*e); 
    tempX[1] = x[1] + T[0]*(x[2]-bet[1]*fal(e,0.5,d)+b[0]*u[0]);
    tempX[2] = x[2] - T[0]*bet[2]*fal(e,0.25,d);
    x[0] = tempX[0]; x[1] = tempX[1]; x[2] = tempX[2];
  }
#endif /* MDL_UPDATE */

#define MDL_DERIVATIVES  /* Change to #undef to remove function */
#if defined(MDL_DERIVATIVES)
  /* Function: mdlDerivatives =================================================
   * Abstract:
   *    In this function, you compute the S-function block's derivatives.
   *    The derivatives are placed in the derivative vector, ssGetdX(S).
   */
  static void mdlDerivatives(SimStruct *S)
  {
  }
#endif /* MDL_DERIVATIVES */

/* Function: mdlTerminate =====================================================
 * Abstract:
 *    In this function, you should perform any actions that are necessary
 *    at the termination of a simulation.  For example, if memory was
 *    allocated in mdlStart, this is the place to free it.
 */
static void mdlTerminate(SimStruct *S)
{
}

/*======================================================*
 * See sfuntmpl_doc.c for the optional S-function methods *
 *======================================================*/

/*=============================*
 * Required S-function trailer *
 *=============================*/

#ifdef  MATLAB_MEX_FILE    /* Is this file being compiled as a MEX-file? */
#include "simulink.c"      /* MEX-file interface mechanism */
#else
#include "cg_sfun.h"       /* Code generation registration function */
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧洲成人av每日更新| 一本大道久久a久久精品综合| 国产一区二区三区四区五区入口| 国产很黄免费观看久久| 91在线云播放| 91精品国产色综合久久久蜜香臀| 久久亚洲一级片| 亚洲视频 欧洲视频| 日韩av不卡在线观看| 丁香激情综合五月| 欧美日韩亚州综合| 国产婷婷色一区二区三区四区| 一区二区成人在线观看| 久久国产视频网| 色综合久久88色综合天天6| 日韩亚洲欧美中文三级| 国产精品久久久久久久久免费相片| 亚洲高清一区二区三区| 国产一区二区成人久久免费影院| 色诱视频网站一区| 久久夜色精品国产噜噜av| 亚洲国产精品久久人人爱蜜臀| 国模冰冰炮一区二区| 欧美亚洲国产一区在线观看网站| 久久久久国产精品免费免费搜索| 亚洲成av人综合在线观看| 国产精品 欧美精品| 欧美日韩不卡在线| 国产精品久久毛片| 蜜臀91精品一区二区三区| 一本色道久久综合狠狠躁的推荐| 久久综合av免费| 亚洲不卡一区二区三区| gogo大胆日本视频一区| ww久久中文字幕| 日韩av网站在线观看| 91精品91久久久中77777| 欧美极品美女视频| 精品一区二区在线播放| 欧美精品久久一区| 亚洲蜜臀av乱码久久精品蜜桃| 国产伦精品一区二区三区视频青涩| 欧美日韩一区二区三区在线看| 国产精品欧美一区二区三区| 久久精品999| 91精品国产麻豆国产自产在线| 亚洲精品高清在线观看| av在线不卡免费看| 国产欧美一区二区精品仙草咪| 裸体健美xxxx欧美裸体表演| 欧美日韩视频不卡| 亚洲精品视频在线| 粉嫩av一区二区三区| 精品第一国产综合精品aⅴ| 日本伊人午夜精品| 欧美精品欧美精品系列| 午夜久久久久久久久| 欧美吻胸吃奶大尺度电影 | 琪琪一区二区三区| 欧美三区在线观看| 亚洲综合激情网| 91免费观看国产| 亚洲色图欧洲色图| thepron国产精品| 成人欧美一区二区三区视频网页| 国产盗摄女厕一区二区三区| 精品99一区二区| 韩国一区二区三区| 久久综合久色欧美综合狠狠| 激情文学综合网| 精品91自产拍在线观看一区| 老色鬼精品视频在线观看播放| 欧美精品久久久久久久久老牛影院 | 日韩成人一级片| 6080yy午夜一二三区久久| 水蜜桃久久夜色精品一区的特点 | 夜夜亚洲天天久久| 色婷婷久久久综合中文字幕 | 在线观看av一区二区| 一区二区三区四区不卡视频| 色婷婷综合五月| 亚洲午夜视频在线| 欧美色男人天堂| 日韩av中文在线观看| 日韩片之四级片| 国产综合色产在线精品| 久久精品一区蜜桃臀影院| 成人午夜在线免费| 中文字幕亚洲一区二区av在线| 91麻豆精品在线观看| 一级日本不卡的影视| 91精品国产综合久久蜜臀| 捆绑变态av一区二区三区| 久久亚洲精华国产精华液| 国产高清在线精品| 亚洲欧美在线观看| 欧美日韩国产一区二区三区地区| 亚洲1区2区3区视频| 精品久久国产字幕高潮| 国产成人鲁色资源国产91色综 | 色综合久久久久久久久| 污片在线观看一区二区| 久久先锋影音av鲁色资源| 国产69精品久久99不卡| 一区二区三区.www| 日韩三级免费观看| 国产精品一线二线三线| 亚洲精品一二三区| 日韩免费福利电影在线观看| 国产suv精品一区二区6| 亚洲国产日韩精品| 亚洲精品一区二区三区香蕉| 96av麻豆蜜桃一区二区| 蜜桃av一区二区在线观看| 国产欧美日韩在线看| 在线看日韩精品电影| 久久国产精品色| 亚洲欧美日韩一区二区| 欧美电影免费观看高清完整版 | 亚洲精品国产第一综合99久久| 69av一区二区三区| 成人免费毛片a| 亚洲国产精品精华液网站| 欧美大片国产精品| 91香蕉国产在线观看软件| 美女国产一区二区三区| 中文字幕一区二区5566日韩| 欧美一级理论片| 9i在线看片成人免费| 日本aⅴ免费视频一区二区三区| 国产精品无码永久免费888| 欧美日韩在线观看一区二区 | 日本一区二区免费在线| 欧美熟乱第一页| 国产九九视频一区二区三区| 午夜在线电影亚洲一区| 中文字幕精品在线不卡| 欧美日韩aaaaaa| 成人精品视频一区二区三区尤物| 肉肉av福利一精品导航| 日韩一区欧美一区| 久久免费美女视频| 欧美精品第1页| 一本在线高清不卡dvd| 国产又粗又猛又爽又黄91精品| 亚洲电影在线免费观看| 国产精品的网站| 精品久久久久久综合日本欧美| 91国在线观看| 成+人+亚洲+综合天堂| 久久国产日韩欧美精品| 亚洲h在线观看| 亚洲久草在线视频| 日本一区二区高清| 日韩欧美的一区二区| 欧美日韩日日摸| 91麻豆成人久久精品二区三区| 国产激情视频一区二区三区欧美| 蜜臀精品久久久久久蜜臀| 又紧又大又爽精品一区二区| 国产精品无遮挡| 国产亚洲欧美激情| 久久综合精品国产一区二区三区| 制服丝袜av成人在线看| 欧美视频一区二| 色婷婷综合久久| 99国产精品视频免费观看| 国产91在线观看丝袜| 国产一区二区福利视频| 黄色精品一二区| 免费成人小视频| 青青草视频一区| 日韩国产在线观看| 视频精品一区二区| 午夜精品成人在线视频| 亚洲一区二区三区四区在线免费观看 | 婷婷开心激情综合| 亚洲成人综合在线| 舔着乳尖日韩一区| 日本女人一区二区三区| 日韩和欧美一区二区三区| 日日摸夜夜添夜夜添亚洲女人| 婷婷夜色潮精品综合在线| 丝袜美腿高跟呻吟高潮一区| 视频一区二区欧美| 欧美aaa在线| 久久99热狠狠色一区二区| 麻豆91精品视频| 国产麻豆日韩欧美久久| 国产不卡视频在线观看| 岛国一区二区在线观看| 高清在线不卡av| 99久久99久久精品免费观看| 99精品黄色片免费大全| 91丝袜美女网| 91国偷自产一区二区开放时间| 色婷婷av久久久久久久| 欧美亚洲国产一卡| 在线电影国产精品| 欧美一级日韩一级|