Block path relative to masked subsystem

Hi there, I'm doing some initialization work in a masked subsystem's initialization callback. I want to set parameters of contained blocks. Currently the only working technique I could come up with is
set_param('model-name/path-to-this-mask-block/child-block', 'param', value );
Is there a way to specify the path relative to the block the mask is for? I tried many combinations including the simple
set_param('child-block', 'param', value );
but nothing I tried would work.

 Respuesta aceptada

Sebastian Castro
Sebastian Castro el 27 de Mzo. de 2016
There is a gcb command which stands for "get current block"... so in your case you can use:
set_param([gcb '/child-block'],'param','value');
- Sebastian

Más respuestas (0)

Categorías

Más información sobre Simulink en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 27 de Mzo. de 2016

Comentada:

el 27 de Mzo. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by