Creating Variable from app.dropdowmenu.value
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, please i need help in creating a variable from user selection in drop down menu.
Example
%I tried this but not working
app.SelectInputDataDropDown.Value = %some equation
0 Commenti
Risposte (1)
Image Analyst
il 22 Giu 2021
Modificato: Image Analyst
il 22 Giu 2021
It's the other way around. The app.SelectInputDataDropDown.Value expression is the user's selection, so to assign that to some variable you want, you have to put it on the right hand side of the equation, like
temperatureInCelsius = app.SelectInputDataDropDown.Value;
temperatureInFahrenheit = (9/5) * temperatureInCelsius + 32;
or perhaps if you want the contents of the list rather than it's index, you can do
allItems = app.SelectInputDataDropDown.String;
selectedIndex = app.SelectInputDataDropDown.Value;
temperatureInCelsius = str2double(allItems{selectedIndex});
temperatureInFahrenheit = (9/5) * temperatureInCelsius + 32;
5 Commenti
Vedere anche
Categorie
Scopri di più su Matrix Indexing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!