Matlab Guis setapp/getapp as global variables?
Mostrar comentarios más antiguos
Hi, I'm trying to use setapp and getapp to pass variable between GUIs. The variables will passed from 1 GUI and then be used to display those variables on another GUI. I got them them to work, however, when I close the GUI and run it, the numbers are still displayed on the screen on the GUI, and I thought they were supposed to be reset since I'm not using global variables.
Here's what im doing.
Gui1
variable1= get(handles.number,'String') %this reads a value from a string that is already displayed on handles.number on GUI1 and assigns it to variable 1
setappdata(0, 'variable1', variable1)
Gui2 (Receives variable1 from GUI2 and displays it in a static text num_display)
variable1= getappdata(0, 'variable1')
set(handles.num_display,'String',variable1)
I want to reset the variables whenever the GUI stops running.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Whos 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!