Effacer les filtres
Effacer les filtres

How can I take two inputs from the same variable

2 vues (au cours des 30 derniers jours)
Kiat Tsen Lim
Kiat Tsen Lim le 29 Mai 2021
Commenté : Kiat Tsen Lim le 1 Juin 2021
Hi good day to all of you, I'm currently working on an app to plot a graph based on certain value inserted. For value fo, the user have choice to use the slider to select the values they want or input their own values within the limit of 4 to 36. When it comes to the coding part, how can I take either both values and yet assign to the same variable which is fo, so far I've assigned fo to both of them but one of it doesn't work, is there a better way to do this ?

Réponse acceptée

Matt J
Matt J le 29 Mai 2021
Modifié(e) : Matt J le 29 Mai 2021
When the Slider is moved, its callback will be invoked. You should set the EditField value in the callback to keep them consistent. Similarly, when then EditField callback is invoked, you should adjust the Slider values.
  8 commentaires
Adam Danz
Adam Danz le 31 Mai 2021
I suggest using one callback function for both objects. You can use the event input to determine which object was changed and the function will merely update the other object.
Kiat Tsen Lim
Kiat Tsen Lim le 1 Juin 2021
thanks for the help! I got it now

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by