Here is the case using GUIDE. I have a pop-up menu with 5 choices(A B C D & E). I also have a push button that do some stuffs. If I run the GUI,I will first choose from the 5 in the pop up menu. Each choice uploads a .mat file in which I retrieve the variable such that:
fullFileName = fullfile(folder, baseFileName)
storedStructure = load(fullFileName);
x = storedStructure.x;
y = storedStructure.y;
Now, when I click that push button I want that push button to retrieve or use x and y for some stuffs directly from the pop up menu function. What code should I write under the callback function of the push button so that that push button will be able to get or retrieve x and y?
If there is something you don't understand in my query just feel free to ask. Thank you very much
No products are associated with this question.
You can store the values of x and y in the handles struct:
handles = guidata(popupMenuHandle); fullFileName = fullfile(folder, baseFileName) storedStructure = load(fullFileName); handles.x = storedStructure.x; handles.y = storedStructure.y; guidata(popupMenuHandle, handles);
Then in the callback of the button:
handles = guidata(buttonHandle); plot(handles.x, handles.y);
Play games and win prizes!Learn more