<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154891</link>
    <title>MATLAB Central Newsreader - GUI--radioButton</title>
    <description>Feed for thread: GUI--radioButton</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>Tue, 21 Aug 2007 16:59:40 -0400</pubDate>
      <title>GUI--radioButton</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154891#388614</link>
      <author>helena raz</author>
      <description>I created a radio button in GUIDE and then right clicked &lt;br&gt;
and chose &quot;View Callback&quot; and then selected callback. this &lt;br&gt;
led to creation of a callback for that radiobutton in my &lt;br&gt;
mfile.   then i deleted the radiobutton call back from &lt;br&gt;
mfile and ran it. i got an error:&lt;br&gt;
&lt;br&gt;
??? Error using ==&amp;gt; feval&lt;br&gt;
Undefined function or method 'InjectTimeOne_Callback' for &lt;br&gt;
input arguments of type 'struct'.&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; gui_mainfcn at 95&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;feval(varargin{:});&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; finalGUI at 42&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gui_mainfcn(gui_State, varargin{:});&lt;br&gt;
&lt;br&gt;
??? Error using ==&amp;gt; finalGUI('InjectTimeOne_Callback',gcbo,&lt;br&gt;
[],guidata(gcbo))&lt;br&gt;
Error using ==&amp;gt; feval&lt;br&gt;
Undefined function or method 'InjectTimeOne_Callback' for &lt;br&gt;
input arguments of type 'struct'.&lt;br&gt;
&lt;br&gt;
??? Error while evaluating uicontrol Callback&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Is there anyway to get rid of radiobutton callback in &lt;br&gt;
mfile without getting an error??  &lt;br&gt;
&lt;br&gt;
If i want to use &quot;switch case...&quot; for a couple of &lt;br&gt;
radiobuttons, then I won't need radiobutton callbacks, &lt;br&gt;
correct? &lt;br&gt;
&lt;br&gt;
thanks a lot! </description>
    </item>
    <item>
      <pubDate>Wed, 22 Aug 2007 16:03:40 -0400</pubDate>
      <title>Re: GUI--radioButton</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154891#388782</link>
      <author>Thomas Clark</author>
      <description>Helena; &lt;br&gt;
&lt;br&gt;
Forgive me if I'm wrong; but I think you've missed a&lt;br&gt;
fundamental point of radiobuttons. Try this, and see if it&lt;br&gt;
helps your understanding of your use:&lt;br&gt;
&lt;br&gt;
Create a button group in a GUI. It's a type of uipanel, but&lt;br&gt;
should only be used for radiobuttons. Drop two radiobuttons&lt;br&gt;
in there. &lt;br&gt;
&lt;br&gt;
Leave it as it is for the mo, but you can change the&lt;br&gt;
start-up values of radiobuttons if you want: right-click &amp;gt;&lt;br&gt;
property editor &amp;gt; value &amp;gt; change from 0.0 to 1.0.&lt;br&gt;
&lt;br&gt;
Start the GUI, then select the unselected button. They&lt;br&gt;
change over automatically, with no need for switch-case or&lt;br&gt;
callbacks.&lt;br&gt;
&lt;br&gt;
Now check the m-file. No callbacks have been created. &lt;br&gt;
&lt;br&gt;
If you want code to execute upon change of radiobutton, then&lt;br&gt;
use the uibuttongroup's SelectionChangeFcn (right-click on&lt;br&gt;
the panel in guide &amp;gt; view callbacks &amp;gt; SelectionChangeFcn).&lt;br&gt;
&lt;br&gt;
If you want code to determine which of the buttons has been&lt;br&gt;
pressed, use:&lt;br&gt;
&lt;br&gt;
h = get(handles.uibuttongroup,'SelectedObject')&lt;br&gt;
&lt;br&gt;
This returns the handle to the selected object. Then use:&lt;br&gt;
&lt;br&gt;
s = get(h,'String')&lt;br&gt;
&lt;br&gt;
To retrieve the string label of the individual button.&lt;br&gt;
&lt;br&gt;
If a callback is automatically created by the GUI (e.g. if&lt;br&gt;
you only want one radiobutton, so don't use a group), then&lt;br&gt;
you can't just delete it without deleting the button in&lt;br&gt;
GUIDE first. If it's unwanted; then what I do is just cut&lt;br&gt;
and paste it right to the bottom of the m-file; then forget&lt;br&gt;
about it forever :)&lt;br&gt;
&lt;br&gt;
I hope that helps, Kind Regards&lt;br&gt;
&lt;br&gt;
Tom Clark</description>
    </item>
    <item>
      <pubDate>Wed, 22 Aug 2007 16:24:12 -0400</pubDate>
      <title>Re: GUI--radioButton</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154891#388786</link>
      <author>helena raz</author>
      <description>Hi Tom,&lt;br&gt;
Thanks a lot for your reply.  &lt;br&gt;
I understand that whenever one creates a uibuttongroup &lt;br&gt;
panel with a couple of radio buttons, there are no &lt;br&gt;
function callbacks for the individual radio buttons.  Like &lt;br&gt;
you said there is SelectionChangeFcn.  &lt;br&gt;
&lt;br&gt;
In my case, however, I right clicked on one of &lt;br&gt;
radiobuttons in guide and then selected callback. this &lt;br&gt;
generated a callback for that specific radiobutton that I &lt;br&gt;
right-clicked on.   so when i tried to delete that from &lt;br&gt;
the mfile (b.c the rest of the radiobuttons did not have a &lt;br&gt;
callback in the mfile), I got an error. &lt;br&gt;
&lt;br&gt;
I guess I should I have deleted that radio button as well. &lt;br&gt;
&lt;br&gt;
Thanks for your help. </description>
    </item>
    <item>
      <pubDate>Thu, 29 Oct 2009 18:48:02 -0400</pubDate>
      <title>Re: GUI--radioButton</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154891#690789</link>
      <author>PinkLab </author>
      <description>I have tried &lt;br&gt;
&lt;br&gt;
Check = get(handles.uibuttongroup,'SelectedObject')&lt;br&gt;
if Check == radiobutton1&lt;br&gt;
% than perform this task&lt;br&gt;
&lt;br&gt;
elseif Check == radiobutton2&lt;br&gt;
% than perform this task&lt;br&gt;
&lt;br&gt;
==================&lt;br&gt;
&lt;br&gt;
It returns the error&lt;br&gt;
&lt;br&gt;
???Reference to non-existent field 'uibuttongroup'&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Any help please? or any alternate way to perform which radio button is selected, I need this for my push button callback, please help! thanks</description>
    </item>
  </channel>
</rss>

