好久没有用过MATLAB,刚重新学就遇到了一个问题,问题如下:
The specified Real-Time Workshop target cannot be used with a variable-step solver. You must configure the solver options for a fixed-step solver with an appropriate integration algorithm (press Open).
我开始以为是我控件没选对,后面搜了一下,回答都有些不是很详细,不适合小白。其实这句报错翻译一下就是,指定的实时目标不能与可变步长求解器一起使用,必须使用适当的集成算法为固定步长求解器配置求解器选项。我把解决方案细致地表述一下。
方法:
1.点击simulink中任务栏Simulation中的Configuration Parameters。
2.在左侧第一行的Solver选项中,找到solver options。
3.找到Type,把勾选的variable-step修改为fixed-step。
4.再重新编译,就会发现bug解决了。