How can I comment out a subsystem from the mask initialisation pane (the subsystem is inside the masked subsystem)?
3 次查看(过去 30 天)
显示 更早的评论
I would like to comment out either this or that subsystem from within the mask initialization pane, depending on the user's choice of a certain mask parameter. But when I use the set_param command, I get these error messages Error in 'xyz': Initialization commands cannot be evaluated. Caused by: Block 'xyz' cannot be commented during execution of a callback
Is this impossible in general, or do I have to use some tricks here?
0 个评论
回答(2 个)
Kiran
2016-2-8
Hi Hans,
The ability to comment out blocks from inside the block callback during the initialization phase is not available in Simulink.
This is expected behavior because the Simulink solver decides the block executing order during the model compilation phase. Therefore, commenting out blocks would be an unexpected behavior for the solver and the model would give an error message.
To enable this kind of behavior, you may use a variant subsystem with a subsystem variant that is just a direct feed-through from the inport to the outport.
Hope this would help.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subsystems 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!