How do I create a mask for my subsystem where each parameter depends on the other parameters in the mask?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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.
Réponse acceptée
MathWorks Support Team
le 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.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Author Block Masks dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!