|
"Mark " <rs_camaro92@remove.thishotmail.com> wrote in message <ggn1h2$jab$1@fred.mathworks.com>...
> I also want to note that I'm using GUIDE to set the position and names of the group and radio buttons along with everything else in my GUI. I then go into the code and tie it into what I need the GUI to do.
>
> I read through many other threads on similar issues, but didn't find any that used GUIDE in making the set-up I'm trying for. I found some code and tweaked it a bit, but it still doesn't work. Here's what I found and edited to suit my needs:
>
> heartrate=uibuttongroup('Position',[.85 .85 .13 .03], 'SelectionChangeFcn',@grv,'units','normalized');
> uicontrol('Style','Radiobutton','Parent',heartrate,'String','Rest (60 bpm)', 'Position',[0 1 1 1],'units','normalized');
> uicontrol('Style','Radiobutton','String','Exercise (120 bpm)', 'Position',[0 0 1 1],'Parent',heartrate,'units','normalized');
>
> I have no clue what the @grv code means, but when I run this, that gives me errors.
You can create a radiobutton panel in guide which will only let you select one radiobutton at a time.
To set the defaults set the value to 1 for selected and 0 for unselected for each radiobutton using set(radiobutton1,'Value',1). Put this in the part of the m file towards the top which is carried out before the GUI is displayed.
|