Azzera filtri
Azzera filtri

Error in acces to the handles of NewValue through the eventdata of a buttongroup

1 visualizzazione (ultimi 30 giorni)
Hello,
I am trying to access to the handles of the new selection inside a buttongroup using the recomendation made in the web reference: http://www.mathworks.de/help/techdoc/creating_guis/f10-998412.html#brrll58-1
function uibuttongroup1_SelectionChangeFcn(hObject,eventdata)
switch get(eventdata.NewValue,'Tag') % Get Tag of selected object.
case 'radiobutton1'
% Code for when radiobutton1 is selected.
case 'radiobutton2'
% Code for when radiobutton2 is selected.
case 'togglebutton1'
% Code for when togglebutton1 is selected.
case 'togglebutton2'
% Code for when togglebutton2 is selected.
% Continue with more cases as necessary.
otherwise
% Code for when there is no match.
end
My concrete code is:
function uipanel17_SelectionChangeFcn(hObject, eventdata, handles)
Tag_Fehler=get(eventdata.NewValue,'Tag'); % Get Tag of selected object.
switch Tag_Fehler
case 'togglebutton2_3F'
set(handles.text2,'String','S-C current, Ippk3 [A]')
case 'togglebutton3_2F'
set(handles.text2,'String','S-C current, Ippk2 [A]')
end
The problem is that I am getting this error that I don´t really uderstand why:
??? Error while evaluating uicontrol Callback
??? Attempt to reference field of non-structure array.
Error in ==> input_biegesteifen>uipanel17_SelectionChangeFcn at 1149 Tag_Fehler=get(eventdata.NewValue,'String');
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> input_biegesteifen at 42 gui_mainfcn(gui_State, varargin{:});
Error in ==> hgfeval at 65 evalin('base', fcn);
Error in ==> uitools.uibuttongroup.childAddedCbk>manageButtons at 80 hgfeval(cbk, source, evdata);
??? Error while evaluating uicontrol Callback
Does someone understands what is the problem?
Thanks a lot,
David Dapuero

Risposte (0)

Categorie

Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by