Info

此问题已关闭。 请重新打开它进行编辑或回答。

How to use variable of another function with a function? switch-case. Matlab Gui

1 次查看(过去 30 天)
I want to call a variable in a popupmenu from a button. I mean, popup value will only show the current status and when I press the button it will operate according to the popup menu status. Here is my code, i get "Undefined function or variable 'popupmenu4value" error when i press the button.
function pushbutton1_Callback(hObject, eventdata, handles)
switch popupmenu4value
case 'A'
%function of A
case 'B'
%function of B
function popupmenu4_Callback(hObject, eventdata, handles)
contents = get(handles.popupmenu4,'String');
popupmenu4value = contents{get(handles.popupmenu4,'Value')};
I found axesMenuToolbar in gui examples but it is written in older verison and i can't use it. what i want is exactly this "axesMenuToolbar" help gui. thanks in advance..

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by