How do I create a mask for my subsystem where each parameter depends on the other parameters in the mask?

4 visualizaciones (últimos 30 días)
I have three parameters in my mask 'a','b','c'. When any of the parameter is changed manually the other parameters must change automatically according to my algorithm. I have placed my algorithm as a callback for all three parameters so that it will be called whenever any of the parameters change. However, this gives rise to recursive behavior of the mask which leads to erroneous results.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 4 de Mayo de 2010
Execution of a mask parameter callback when the mask dialog box opens is intended behavior. The callbacks execute when the dialog first opens, allowing Simulink to initialize the dialog properly. Note that mask parameter callbacks are typically used to manipulate the enabled and visible states of mask parameters in dynamic dialogs
In cases where the mask callbacks lead to recursive behavior it is best to change the design of the mask. The original design can lead to recursive calls which can be very error prone. A better design would be to have the user choose which variable they would like to update and calculate the other variables inside the mask. An example is attached.

Más respuestas (0)

Categorías

Más información sobre Author Block Masks en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by