Simulink: comment block by set_param in callback

조회 수: 8 (최근 30일)
Alexander
Alexander 2015년 10월 14일
편집: Alexander 2015년 10월 14일
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에서 Programmatic Model Editing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by