How can I comment out Simulink subsystem from Matlab script?

75 visualizaciones (últimos 30 días)
Hi,
I just found out that there is a great option in Simulink which allows to comment out blocks and subsystems and exclude them form simulaton (right-click on block -> Comment out). I'd like to know, how can I do that using Matlab sctipt (or is it even possible?).
Thanks, Krzysztof

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 20 de Sept. de 2013
Suppose your model name is untitled , and you want to comment out the block named Unit Delay
set_param('untitled/Unit Delay','commented','on')
% to uncomment
set_param('untitled/Unit Delay','commented','off')
  7 comentarios
RAGHUVEER RAJESH
RAGHUVEER RAJESH el 21 de Sept. de 2023
Yes. true, its not working for a subsystem. The command is only applicable for simulink blocks. Has anyone else explore some other solution.

Iniciar sesión para comentar.

Más respuestas (1)

Hajir Pourbabak
Hajir Pourbabak el 23 de Mzo. de 2016
Thanks A lot!

Categorías

Más información sobre Subsystems en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by