Simulink: comment block by set_param in callback

2 次查看(过去 30 天)
I am trying to use the PostLoad Callback to comment out Simulink blocks depending on parameters. So, in a file I have a parameter
UseBlock = 1;% or 0
The Postload function runs this file and knows the value of this parameter and if UseBlock is zero, the Postload function is supposed to comment out a certain block, if the value is 1 it is supposed to uncomment the block. I am using
set_param('Model/Block','Commented','on') % or 'off'
However, it does not work and interestingly any code occuring after this line (in the Postload Callback) is not executed. But I do not see any errors whatsoever.
Any ideas?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Model, Block, and Port Callbacks 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by