<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240042</link>
    <title>MATLAB Central Newsreader - GUI - grouping radio buttons</title>
    <description>Feed for thread: GUI - grouping radio buttons</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 27 Nov 2008 20:16:02 -0500</pubDate>
      <title>GUI - grouping radio buttons</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240042#613629</link>
      <author>Mark </author>
      <description>I'm trying to make a button group with 2 radio buttons inside it.  I want them to toggle between each other and never have both on or off at the same time.  With that, I want to store the value generated into a variable to use in an if then statement later in my code.&lt;br&gt;
&lt;br&gt;
Also, I want to set one of the buttons as default on when the gui starts.&lt;br&gt;
&lt;br&gt;
How do I do all of this?&lt;br&gt;
&lt;br&gt;
Sincerely,&lt;br&gt;
Mark</description>
    </item>
    <item>
      <pubDate>Thu, 27 Nov 2008 20:56:02 -0500</pubDate>
      <title>Re: GUI - grouping radio buttons</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240042#613635</link>
      <author>Mark </author>
      <description>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.&lt;br&gt;
&lt;br&gt;
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:&lt;br&gt;
&lt;br&gt;
heartrate=uibuttongroup('Position',[.85 .85 .13 .03], 'SelectionChangeFcn',@grv,'units','normalized');&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;uicontrol('Style','Radiobutton','Parent',heartrate,'String','Rest (60 bpm)', 'Position',[0 1 1 1],'units','normalized');&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;uicontrol('Style','Radiobutton','String','Exercise (120 bpm)', 'Position',[0 0 1 1],'Parent',heartrate,'units','normalized');&lt;br&gt;
&lt;br&gt;
I have no clue what the @grv code means, but when I run this, that gives me errors.</description>
    </item>
    <item>
      <pubDate>Sat, 29 Nov 2008 16:56:02 -0500</pubDate>
      <title>Re: GUI - grouping radio buttons</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240042#613870</link>
      <author>Dave Brackett</author>
      <description>&quot;Mark &quot; &amp;lt;rs_camaro92@remove.thishotmail.com&amp;gt; wrote in message &amp;lt;ggn1h2$jab$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; 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.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; heartrate=uibuttongroup('Position',[.85 .85 .13 .03], 'SelectionChangeFcn',@grv,'units','normalized');&lt;br&gt;
&amp;gt;     uicontrol('Style','Radiobutton','Parent',heartrate,'String','Rest (60 bpm)', 'Position',[0 1 1 1],'units','normalized');&lt;br&gt;
&amp;gt;     uicontrol('Style','Radiobutton','String','Exercise (120 bpm)', 'Position',[0 0 1 1],'Parent',heartrate,'units','normalized');&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have no clue what the @grv code means, but when I run this, that gives me errors.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
You can create a radiobutton panel in guide which will only let you select one radiobutton at a time. &lt;br&gt;
&lt;br&gt;
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.</description>
    </item>
  </channel>
</rss>

