将Simulink和m脚本与assert块和回调结合使用

时间:2019-01-08 09:42:32

标签: matlab simulink assert

我在assert块的帮助下结合使用了simulink和m-script。我已经在assert块中取消选中“断言失败时停止仿真”。现在,我想添加三个命令:

  1. set_param(bdroot,'SimulationCommand','pause');
  2. run('myscript.m'); %插入脚本名称
  3. set_param(bdroot,'SimulationCommand','continue');

运行第二个命令时,出现以下错误消息:

[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=781/phong; Already registered: pimp/worldmodelmaterial:uniqueID=781/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=795/phong; Already registered: pimp/worldmodelmaterial:uniqueID=795/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=797/phong; Already registered: pimp/worldmodelmaterial:uniqueID=797/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=799/phong; Already registered: pimp/worldmodelmaterial:uniqueID=799/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=801/phong; Already registered: pimp/worldmodelmaterial:uniqueID=801/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=803/phong; Already registered: pimp/worldmodelmaterial:uniqueID=803/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=805/phong; Already registered: pimp/worldmodelmaterial:uniqueID=805/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=807/phong; Already registered: pimp/worldmodelmaterial:uniqueID=807/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=809/phong; Already registered: pimp/worldmodelmaterial:uniqueID=809/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=811/phong; Already registered: pimp/worldmodelmaterial:uniqueID=811/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=813/phong; Already registered: pimp/worldmodelmaterial:uniqueID=813/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=777/phong; Already registered: pimp/worldmodelmaterial:uniqueID=777/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=815/phong; Already registered: pimp/worldmodelmaterial:uniqueID=815/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=817/phong; Already registered: pimp/worldmodelmaterial:uniqueID=817/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=819/phong; Already registered: pimp/worldmodelmaterial:uniqueID=819/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=821/phong; Already registered: pimp/worldmodelmaterial:uniqueID=821/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=823/phong; Already registered: pimp/worldmodelmaterial:uniqueID=823/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=825/phong; Already registered: pimp/worldmodelmaterial:uniqueID=825/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=827/phong; Already registered: pimp/worldmodelmaterial:uniqueID=827/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=829/phong; Already registered: pimp/worldmodelmaterial:uniqueID=829/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=831/phong; Already registered: pimp/worldmodelmaterial:uniqueID=831/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=833/phong; Already registered: pimp/worldmodelmaterial:uniqueID=833/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=779/phong; Already registered: pimp/worldmodelmaterial:uniqueID=779/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=835/phong; Already registered: pimp/worldmodelmaterial:uniqueID=835/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=837/phong; Already registered: pimp/worldmodelmaterial:uniqueID=837/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=839/phong; Already registered: pimp/worldmodelmaterial:uniqueID=839/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=841/phong; Already registered: pimp/worldmodelmaterial:uniqueID=841/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=843/phong; Already registered: pimp/worldmodelmaterial:uniqueID=843/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=783/phong; Already registered: pimp/worldmodelmaterial:uniqueID=783/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=785/phong; Already registered: pimp/worldmodelmaterial:uniqueID=785/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=787/phong; Already registered: pimp/worldmodelmaterial:uniqueID=787/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=789/phong; Already registered: pimp/worldmodelmaterial:uniqueID=789/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=791/phong; Already registered: pimp/worldmodelmaterial:uniqueID=791/phong
Interface is registered twice for writing.
[DataProvider              ] WRN: 
Registering: pimp/worldmodelmaterial:uniqueID=793/phong; Already registered: pimp/worldmodelmaterial:uniqueID=793/phong
Interface is registered twice for writing.


An error occurred while running the simulation and the simulation was terminated
Caused by:
Error evaluating 'AssertionFcn' callback of Assertion block 'ADAS001_Kalibrierung_Fehlerfortpflanzung_Var_cs/Box_1/Assertion'.
Not enough input arguments.
Component: Simulink | Category: Block error

此外,我只能执行一个回调命令。如何执行多个命令? -我已经尝试用或;分隔这些命令。

0 个答案:

没有答案