<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265253</link>
    <title>MATLAB Central Newsreader - handles pass strings</title>
    <description>Feed for thread: handles pass strings</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>Sat, 07 Nov 2009 18:39:01 -0500</pubDate>
      <title>handles pass strings</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265253#692915</link>
      <author>eematic ee</author>
      <description>Do &quot;handles&quot; pass strings?  I have a program that enters a string using a popup box and passes it using handles to a input callback then an Evaluation callback.  The proces worked for a number.  In the Evaluation callback there is an error:&lt;br&gt;
&lt;br&gt;
if alpha = 'A' then&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delta = -delta;&lt;br&gt;
end;&lt;br&gt;
&lt;br&gt;
The error is in the equals statement in &quot;if alpha = 'A' then&quot;.  Does this mean that &quot;handles&quot; is not passing strings thru alpha to the Evaluation callback?</description>
    </item>
    <item>
      <pubDate>Sat, 07 Nov 2009 19:02:02 -0500</pubDate>
      <title>Re: handles pass strings</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265253#692919</link>
      <author>ucd puri</author>
      <description>i would say rather try &lt;br&gt;
strcmp(alpha,'A') ---&amp;gt; strcmp is case sensitive&lt;br&gt;
strcmpi(alpha,'A') ---&amp;gt; strcmpi is NOT case sensitive</description>
    </item>
    <item>
      <pubDate>Sat, 07 Nov 2009 20:20:04 -0500</pubDate>
      <title>Re: handles pass strings</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265253#692927</link>
      <author>eematic ee</author>
      <description>&amp;nbsp;strcmp(alpha,'A') works but I am not receiving the string from the popup box.  &lt;br&gt;
&lt;br&gt;
Check my code:&lt;br&gt;
&lt;br&gt;
alpha = uicontrol('Style','popup','String','Beta|Gamma','position',[120,675,40,20],'Callback',(@h_alpha));&lt;br&gt;
&lt;br&gt;
function h_alpha(hObject, eventdata, handles)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;alpha = str2double(get(hObject,'String'));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;handles = guidata(hObject);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;guidata(hObject, setfield(handles,'alpha',alpha));&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Remember this works for numbers without the popup box!</description>
    </item>
    <item>
      <pubDate>Sun, 08 Nov 2009 02:11:02 -0500</pubDate>
      <title>Re: handles pass strings</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265253#692952</link>
      <author>ucd puri</author>
      <description>the h_alpha function works to seems fine for me.&lt;br&gt;
&lt;br&gt;
if u are using the  [ alpha = str2double(get(hObject,'String'));  ]   line in your function and passing string input from popup, it would set ur alpha value to NaN... &lt;br&gt;
&lt;br&gt;
i mean &lt;br&gt;
alpha = uicontrol('Style','popup','String','2|3','position',[120,675,40,20],'Callback',(@h_alpha));&lt;br&gt;
will return alpha value as a number, but if u use&lt;br&gt;
alpha = uicontrol('Style','popup','String','alpha|beta','position',[120,675,40,20],'Callback',(@h_alpha));&lt;br&gt;
then what output do u expect from str2double('alpha') ??  </description>
    </item>
  </channel>
</rss>

