代码之家  ›  专栏  ›  技术社区  ›  Sam Gomari

在Sfunction(ssGetT)中获取Sim卡时间?

  •  0
  • Sam Gomari  · 技术社区  · 7 年前

    我使用了ssGetT(S),因为某些原因似乎不起作用。 简单模型,是固定时间步长为0.01秒的“timestwo”(自动解算器)

    我在mdlOutput()中称之为

    static void mdlOutputs(SimStruct *S, int_T tid)
    {
        int_T i;
        InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs(S,0);
        real_T *y = ssGetOutputPortRealSignal(S,0);
        int_T width = ssGetOutputPortWidth(S,0);
    
        //for (i=0; i<width; i++) {
        //     *y++ = 2.0 *(*uPtrs[i]);
        //}
    
        *y = (real_T)ssGetT(S);
    }
    
    0 回复  |  直到 7 年前