MATLAB: How to address the children of an axes (GUI)

axeschildrenguiplot

Hello together,
I want to address the children of an axes in another function of my GUI without using findobj. A radiobutton should allow the user to switch between different views of the axes to set texts, lines, groups, … into noshow/show. Therefore I assigned special tags to the children, but until yet I haven't get it out how to address them. Here you can see the code including findobj:
function rb_ansicht_re_Callback(hObject, eventdata, handles)
global jj
childs=allchild(handles.axes_delta_s);
switch jj
case 2
set(findobj(childs, 'Tag','h_delta_s_1'), 'Visible', 'off')
set(findobj(childs, 'Tag','h_delta_s_2'), 'Visible', 'on')
set(findobj(childs, 'Tag','h_delta_s_k_1'), 'Visible', 'off')
set(findobj(childs, 'Tag','h_delta_s_k_2'), 'Visible', 'on')
set(findobj(childs, 'Tag','h_fi_fl_1'), 'Visible', 'off')
set(findobj(childs, 'Tag','h_fi_fl_2'), 'Visible', 'on')
case 1
% do nothing
end
For suggestions I would be very grateful :-).
With best regards Gina

Best Answer

I assume, from the callback syntax, that this is a GUIDE GUI. If so then all your GUI components are stored on the handles structure as fields whose names are the tags that you use in the findobj command so:
handles.h_delta_s_1.Visible = 'off';
etc, should work fine. Or if you are in an older version of Matlab
set( handles.h_delta_s_1, 'Visible', 'off' )
Also don't use global variables. Just dropping jj in from goodness knows where is bad programming practice. If this is your radiobutton then access it also via handles and its tag.