1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| figure
% Create the button group.
h = uibuttongroup('visible','off','Position',[0 0 .3 1],'Clipping','on');
% Create three radio buttons in the button group.
u0 = uicontrol('Style','Radio',...
'pos',[100 350 15 15],'parent',h);
t0 = uicontrol('Style','text','String','Option1',...
'pos',[5 350 90 15],'parent',h,'HorizontalAlignment','right');
u1 = uicontrol('Style','Radio',...
'pos',[100 250 15 15],'parent',h);
t1 = uicontrol('Style','text','String','Option2',...
'pos',[5 250 90 15],'parent',h,'HorizontalAlignment','right');
u2 = uicontrol('Style','Radio',...
'pos',[100 150 15 15],'parent',h);
t2 = uicontrol('Style','text','String','Option3',...
'pos',[5 150 90 15],'parent',h,'HorizontalAlignment','right');
% Initialize some button group properties.
set(h,'SelectionChangeFcn',@selcbk);
set(h,'SelectedObject',[]); % No selection
set(h,'Visible','on'); |
Partager