How can I pass options from popupmenu to another callback function?
Mostrar comentarios más antiguos
Hi all! I'm programming a GUI. I have a popup menu that enables to display differents signals depending on the option selected. In the callback function of popup menu I've write this code:
% Determine the selected data set.
str = get(source, 'String');
val = get(source,'Value');
% Set current data to the selected data set.
switch str{val}
case 'Delta' % User selects Delta.
current_data = delta;
case 'Theta' % User selects Theta.
current_data = theta;
case 'Alpha' % User selects Alpha.
current_data = alpha;
case 'Beta' % User selects Beta.
current_data = beta;
case 'Gamma' % User selects Gamma.
current_data = gamma;
end
Now I've to pass the option selected to a pushbutton's callback function that generates plot when pushed by users. How can I do this? It would very helpful for me to resolve this problem. Thanks in advance.
[EDITED, code formatted, Jan]
Respuesta aceptada
Más respuestas (1)
Fa'
el 20 de Jul. de 2012
0 votos
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!