<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/253755</link>
    <title>MATLAB Central Newsreader - str2func with cell input arguments</title>
    <description>Feed for thread: str2func with cell input arguments</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>Mon, 15 Jun 2009 19:08:02 -0400</pubDate>
      <title>str2func with cell input arguments</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/253755#657490</link>
      <author>Dave Brackett</author>
      <description>Up until recently I have been using str2func for specifying some options for an optimisation run. With r2009a this is no longer allowed and I get the error message: &quot;??? Undefined function or method 'str2func' for input arguments of type 'cell'.&quot;&lt;br&gt;
&lt;br&gt;
This worked fine in 2008a and I read from Loren's blog that there have been some changes to str2func in the latest release (Starting in Release 2009a, str2func lets you create a handle to anonymous function. Before that, you need to construct an anonymous function from literal strings, or using some ugly code involving eval.). &lt;br&gt;
&lt;br&gt;
I cannot work out what I need to change to get it to work in my case. Can anyone shed some light on what I'm missing please? Thanks. A snippet of the code is below:&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;options=saoptimset('AnnealingFcn',str2func(current_options.annealing_function),...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'TemperatureFcn',str2func(current_options.temperature_function),...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'AcceptanceFcn',str2func(current_options.acceptance_function));</description>
    </item>
    <item>
      <pubDate>Mon, 15 Jun 2009 19:20:18 -0400</pubDate>
      <title>Re: str2func with cell input arguments</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/253755#657493</link>
      <author>Dave Brackett</author>
      <description>&quot;Dave Brackett&quot; &amp;lt;davebrackett@hotmail.com&amp;gt; wrote in message &amp;lt;h1666i$8n9$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Up until recently I have been using str2func for specifying some options for an optimisation run. With r2009a this is no longer allowed and I get the error message: &quot;??? Undefined function or method 'str2func' for input arguments of type 'cell'.&quot;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; This worked fine in 2008a and I read from Loren's blog that there have been some changes to str2func in the latest release (Starting in Release 2009a, str2func lets you create a handle to anonymous function. Before that, you need to construct an anonymous function from literal strings, or using some ugly code involving eval.). &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I cannot work out what I need to change to get it to work in my case. Can anyone shed some light on what I'm missing please? Thanks. A snippet of the code is below:&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt;    options=saoptimset('AnnealingFcn',str2func(current_options.annealing_function),...&lt;br&gt;
&amp;gt;             'TemperatureFcn',str2func(current_options.temperature_function),...&lt;br&gt;
&amp;gt;             'AcceptanceFcn',str2func(current_options.acceptance_function));&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
ah isn't it always the way that as soon as you post the question, you work out the answer! Simply just needs to use char() to convert from cell. Funny I didn't think of that earlier!</description>
    </item>
  </channel>
</rss>

