How can I modify the model callback functions programmatically?
16 views (last 30 days)
Show older comments
MathWorks Support Team
on 13 Dec 2018
Answered: MathWorks Support Team
on 13 Dec 2018
How can I modify the Simulink model callback functions programmatically?
Accepted Answer
MathWorks Support Team
on 13 Dec 2018
You may use the "set_param" function.
Here is the example code about how to change the 'InitFcn' programmatically using one of our shipped example 'vdp.slx':
>> vdp
>> set_param('vdp','InitFcn','a = 2;')
or
>> vdp
>> set_param(gcs,'InitFcn','a = 2;')
Please reference our documentation page for more details about the 'set_param' function and Model Callbacks:
0 Comments
More Answers (0)
See Also
Categories
Find more on Model, Block, and Port Callbacks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!