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

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

?? test.c

?? 用c語言編寫的simulink中的s函數
?? 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-2002 The MathWorks, Inc.
 * $Revision: 1.27 $
 */


/*
 * 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  test
#define S_FUNCTION_LEVEL 2
#define INPUT_NUM 2
#define OUTPUT_NUM 2
#define PARA_NUM 2
/*
 * Need to include simstruc.h for the definition of the SimStruct and
 * its associated macro definitions.
 */
#include "simstruc.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.
 */

/*====================*
 * 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,PARA_NUM);  /* Number of expected parameters */
    if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {
        /* Return if number of expected != number of actual parameters */
        return;
    }

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

    if (!ssSetNumInputPorts(S, INPUT_NUM)) return;
    
    ssSetInputPortWidth(S, 0, 3);
    ssSetInputPortRequiredContiguous(S, 0, true); /*direct input signal access*/
    
        ssSetInputPortWidth(S, 1, 3);
    ssSetInputPortRequiredContiguous(S, 1, 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, 1);
    ssSetInputPortDirectFeedThrough(S, 1, 1);
    
    if (!ssSetNumOutputPorts(S, OUTPUT_NUM)) return;
    ssSetOutputPortWidth(S, 0, 3);
    ssSetOutputPortWidth(S, 1, 3);
    
    ssSetNumSampleTimes(S, 1);
    ssSetNumRWork(S, 0);
    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, CONTINUOUS_SAMPLE_TIME);
    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)
{
     real_T *para1 = mxGetPr(ssGetSFcnParam(S,0));
	real_T *para2 = mxGetPr(ssGetSFcnParam(S,1));
    const real_T *u1 = (const real_T*) ssGetInputPortSignal(S,0);
    const real_T *u2 = (const real_T*) ssGetInputPortSignal(S,1);
    
    real_T       *y1 = ssGetOutputPortSignal(S,0);
    real_T       *y2 = ssGetOutputPortSignal(S,1);
    
    
    y1[0] = para1[0]*u1[0];
    y1[1] = para1[0]*u1[1];
    y1[2] = para1[0]*u1[2];
    y2[0]=para2[0]*u2[0];
    y2[1]=para2[0]*u2[1];
    y2[2]=para2[0]*u2[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)
  {
  }
#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一区二区三区免费野_久草精品视频
亚洲影院免费观看| gogo大胆日本视频一区| 国产在线精品免费av| 国产成人在线色| 91视频.com| 欧美一区二区国产| 国产欧美日韩另类视频免费观看| 亚洲啪啪综合av一区二区三区| 天堂va蜜桃一区二区三区漫画版| 黄色资源网久久资源365| www.在线欧美| 日韩欧美中文字幕精品| 国产精品超碰97尤物18| 日韩成人dvd| av一区二区三区| 日韩一区二区三区四区| 国产精品免费看片| 日本欧美一区二区| 99在线精品免费| 日韩精品一区二区三区中文不卡| 国产精品久久久爽爽爽麻豆色哟哟| 亚洲va韩国va欧美va精品| 国产激情精品久久久第一区二区 | 久久日一线二线三线suv| √…a在线天堂一区| 麻豆久久久久久久| 色婷婷综合久久久中文一区二区| 欧美大黄免费观看| 一区二区三区欧美亚洲| 国产精品99久久久久久有的能看| 欧美日韩一区国产| 国产精品日韩成人| 久久精品国产一区二区三| 色偷偷88欧美精品久久久| 久久久精品欧美丰满| 无吗不卡中文字幕| 91色婷婷久久久久合中文| 26uuu精品一区二区| 日韩电影一区二区三区| 一本久久a久久免费精品不卡| 国产亚洲欧美在线| 日韩av电影免费观看高清完整版 | 18成人在线观看| 国产精品一区二区你懂的| 欧美肥大bbwbbw高潮| 国产精品午夜免费| 精品一区二区三区在线视频| 欧美三级资源在线| 亚洲欧美一区二区三区极速播放| 国产综合久久久久影院| 8x8x8国产精品| 亚洲一区视频在线观看视频| 99久久伊人精品| 国产女同互慰高潮91漫画| 久久www免费人成看片高清| 欧美老人xxxx18| 亚洲高清三级视频| 日本韩国欧美在线| 1024亚洲合集| 91性感美女视频| 一区在线中文字幕| 不卡的av在线| 中文av一区特黄| 韩国毛片一区二区三区| 欧美成人a在线| 久久er精品视频| 欧美zozozo| 精品一区二区三区免费播放| 日韩午夜中文字幕| 蜜臀av性久久久久av蜜臀妖精| 欧美高清精品3d| 日韩精品色哟哟| 91精品国产91久久综合桃花| 亚洲国产色一区| 欧美男男青年gay1069videost| 亚洲国产一区二区三区| 欧美日韩亚洲另类| 午夜精品久久久久久久久久 | 日本不卡1234视频| 欧美一区二区三区成人| 日本成人中文字幕在线视频| 91精品在线麻豆| 久久电影网站中文字幕| 久久久午夜精品理论片中文字幕| 国产精品一区二区在线看| 国产亚洲精品bt天堂精选| 粉嫩欧美一区二区三区高清影视| 国产精品嫩草影院av蜜臀| 粉嫩aⅴ一区二区三区四区 | 在线看不卡av| 亚洲一区二区三区四区五区中文 | 日韩精品久久理论片| 欧美一区二区三区系列电影| 精品一区免费av| 欧美国产成人在线| 色94色欧美sute亚洲线路二 | 日韩一区二区中文字幕| 激情欧美日韩一区二区| 日本一区二区免费在线| 欧美一卡在线观看| 欧美高清激情brazzers| 中文字幕在线不卡一区二区三区 | 日韩国产欧美在线播放| 亚洲精品免费在线| 国产精品不卡一区二区三区| 久久久99久久| 69堂亚洲精品首页| 日本韩国欧美在线| 99国产精品99久久久久久| 成人av网站在线观看免费| 麻豆国产精品777777在线| 最新日韩av在线| 久久精品一区二区三区不卡牛牛| 亚洲午夜精品17c| 成人国产在线观看| 亚洲国产精品自拍| 2021久久国产精品不只是精品| 不卡的av电影在线观看| 亚洲国产成人av| 久久亚洲综合av| 在线观看国产日韩| 国产在线观看一区二区| 亚洲欧美成aⅴ人在线观看| 欧美一个色资源| 一本久久a久久免费精品不卡| 久久精品国产亚洲a| 专区另类欧美日韩| 日韩精品中文字幕在线一区| 99国产精品一区| 久草热8精品视频在线观看| 亚洲免费电影在线| 久久综合久久综合久久| 欧美视频精品在线观看| 国产精品1区2区3区在线观看| 亚洲制服丝袜av| 国产欧美日韩激情| 欧美一区二区三区男人的天堂| 91丝袜美女网| 国产精品资源在线| 丝袜美腿亚洲综合| 亚洲免费观看高清| 中文字幕不卡的av| 日韩一卡二卡三卡四卡| 在线观看网站黄不卡| 高清不卡一二三区| 狠狠色丁香久久婷婷综合_中| 亚洲国产精品精华液网站| 色中色一区二区| 精品剧情在线观看| 首页国产欧美久久| 国产精品一区二区在线观看网站| 欧美优质美女网站| 中文字幕一区二区三区精华液 | 91精品国产综合久久福利软件| 蜜臀av在线播放一区二区三区| 欧美精品视频www在线观看| 中文字幕一区二区三区视频| 久久精品国产成人一区二区三区| 97se亚洲国产综合自在线不卡| 亚洲第一电影网| 国产日韩欧美精品在线| 精品视频999| 日韩成人伦理电影在线观看| 95精品视频在线| 亚洲欧洲性图库| 成人免费看片app下载| www国产成人| 一区二区三区在线观看网站| 国产一区二区女| 精品国一区二区三区| 亚洲成av人片观看| 欧美午夜片在线观看| 久草在线在线精品观看| 欧美视频中文字幕| 高清不卡一区二区| 日韩电影网1区2区| 欧美一卡二卡三卡| 99天天综合性| 蜜桃视频第一区免费观看| 久久婷婷国产综合国色天香| av在线播放成人| 日本一区中文字幕| 久久久精品国产免大香伊| 色狠狠一区二区| 日韩在线a电影| 中文字幕一区二区三区在线播放| 成人免费看黄yyy456| 午夜精品123| 中文字幕精品一区二区三区精品| 一本一本大道香蕉久在线精品| 亚洲午夜av在线| 国产精品视频一二| 欧美日韩高清在线播放| 国产麻豆精品95视频| 亚洲欧美另类久久久精品| 欧美精品vⅰdeose4hd| 久久精品国产一区二区三| 2021国产精品久久精品| 国产精品一区二区三区乱码| 亚洲精品日产精品乱码不卡|