When i work in gui and go to editor i get this kind of code (for example):
function radiobutton2_Callback(hObject, eventdata, handles)
and bellow of it i add what i want to do if this object is selected.But this code works too (just example):
h = uibuttongroup('Pos',[0 0 .2 1]);u0 = uicontrol(h,'Style','Radio','String','Option 1',... 'pos',[10 350 100 30]);u1 = uicontrol(h,'Style','Radio','String','Option 2',... 'pos',[10 250 100 30]);u2 = uicontrol(h,'Style','Radio','String','Option 3',... 'pos',[10 150 100 30]);set(h,'SelectedObject',u2); % Set the object.
The second code gives you figure at opening from editor too, but i don't know how.Any help?
Best Answer