How do I create a mask for my subsystem where each parameter depends on the other parameters in the mask?
4 views (last 30 days)
Show older comments
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.
Accepted Answer
MathWorks Support Team
on 4 May 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.
0 Comments
More Answers (0)
See Also
Categories
Find more on Author Block Masks in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!