【程序语言】【MATLAB】Invalid constructs include the use of persistent or global variables

在Simulink里面对速度曲线积分,直接在速度模块后面接积分器
在这里插入图片描述
有一个报错信息:
在这里插入图片描述
因为在Simulink里面用到了全局变量,MATLAB answer里面给了一个解释

You can switch the entire model to discrete time or you can use rate transition blocks to move back and forth between continuous and discrete .

也就是说要把连续变量转化成离散量才能正常使用。把积分器改成Rate Transition和Discrete-Time Integrator就解决了

在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章