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

4 Ansichten (letzte 30 Tage)
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.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 4 Mai 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.

Weitere Antworten (0)

Kategorien

Mehr zu Author Block Masks finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by