How can I modify the model callback functions programmatically?

16 views (last 30 days)

Accepted Answer

MathWorks Support Team
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:

More Answers (0)

Tags

No tags entered yet.

Products


Release

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!