当我在matlab中定义局部变量时,simulink.Here is the mdlOutput function.it给了我一个错误。
//////
static void mdlOutputs(SimStruct *S, int_T tid)
{
real_T *y = ssGetOutputPortRealSignal(S,0);// no error
real_T *x = ssGetContStates(S);//no error
UNUSED_ARG(tid);
real_T *a;// error:missing ';' before 'type'
real_T *b=5.0//error: illegal use of this type as an expression
}不仅仅是real_T,我不能在函数内部定义任何类型的局部变量,除了已经在顶部的template.Using静态变量中定义的y和x。is with fine.What可能是普通变量的问题?
发布于 2012-08-08 12:38:14
我得到了它,.I必须在UNUSED_ARG(tid)命令之前定义变量
https://stackoverflow.com/questions/11857574
复制相似问题