フィルターのクリア

problem with using if statements

3 ビュー (過去 30 日間)
joanna
joanna 2012 年 11 月 6 日
i have 2 options in popupmenu and both of the options has 2 panels which contain pushbutton. when i select option1, the pushbutton in panel2 is disabled..when i select option2, the pushbutton in panel1 is disabled.
v=get(handles.selectGroup, 'Value');
switch v
case 1
set(handles.capturecolorButton,'Enable','off');
set(handles.ROI2Button,'Enable','on');
case 2
set(handles.capturecolorButton,'Enable','on');
set(handles.ROI2Button,'Enable','off');
otherwise
end;
what can be corrected?
  6 件のコメント
Arthur
Arthur 2012 年 11 月 6 日
Please copy the entire error message you get, we're shooting in the dark here....
joanna
joanna 2012 年 11 月 6 日
??? Attempt to reference field of non-structure array.
Error in ==> capture>selectGroup_CreateFcn at 464 v=get(handles.selectGroup, 'Value');
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> capture at 42 gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)capture('selectGroup_CreateFcn',hObject,eventdata,guidata(hObject))
??? Error using ==> struct2handle Error while evaluating uicontrol CreateFcn

サインインしてコメントする。

採用された回答

Arthur
Arthur 2012 年 11 月 6 日
You placed the code intothe CreateFcn of te popup. This means the code is only executed when the popup is created, not when you press it. Cut and paste the code into the CallbackFcn of the popup, and it probably works.
  1 件のコメント
joanna
joanna 2012 年 11 月 6 日
thank you. it worked.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by