【程序語言】【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就解決了

在這裏插入圖片描述

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