control simulink from M-file

后端 未结 3 2020
清酒与你
清酒与你 2021-01-07 06:22

I am trying to control a simulink from a M-file. What I want to do in the M-file is give the simulink model some input, run the simulink model, change one input value at 0.6

3条回答
  •  伪装坚强ぢ
    2021-01-07 06:52

    You can get the current time of a running simulation with:

    get_param('simulink_model_name', 'SimulationTime');
    

    So for instance by checking this value from your M-file during simulation by using

    timer(...)
    

    you can detect when the simulation is at 0.6 seconds.

提交回复
热议问题