Effacer les filtres
Effacer les filtres

Use UICONTROL for listbox

8 vues (au cours des 30 derniers jours)
Amanda
Amanda le 29 Mai 2013
I need to use uicontrol to create a listbox. Instead of changing the variables each time the script is executed, I want to be able to change it on a GUI screen. So my list is composed of 5 variables:
mass
velocity
time
acceleration
speed
and these 5 variables have data.
Thanks,
Amanda

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 29 Mai 2013
Modifié(e) : Azzi Abdelmalek le 29 Mai 2013
yourcell={'mass','velocity','time','acceleration','speed'}
uicontrol('Style', 'listbox','Position',[100 100 200 200],...
'string',yourcell,'Callback',@yourfunction)
%---------------add your function---------------------
function yourfunction(hObj,event)
v=get(hObj,'value')
%do
end
  1 commentaire
Amanda
Amanda le 29 Mai 2013
Thanks a lot.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by