<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/242704</link>
    <title>MATLAB Central Newsreader - num2str in loop</title>
    <description>Feed for thread: num2str in loop</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, 20 Jan 2009 00:22:01 -0500</pubDate>
      <title>num2str in loop</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/242704#622629</link>
      <author>simon ott</author>
      <description>hello&lt;br&gt;
I want to assign the name of a variable based on loop iteration. &lt;br&gt;
&lt;br&gt;
b = [3 4 ]&lt;br&gt;
&lt;br&gt;
Iteration = 1: 2&lt;br&gt;
&lt;br&gt;
['abc' num2str(Iteration)] =   b(i) &lt;br&gt;
&lt;br&gt;
End&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
But it does not work&lt;br&gt;
&lt;br&gt;
Any hint ?</description>
    </item>
    <item>
      <pubDate>Tue, 20 Jan 2009 00:30:06 -0500</pubDate>
      <title>Re: num2str in loop</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/242704#622631</link>
      <author>Sadik </author>
      <description>&quot;simon ott&quot; &amp;lt;simon_ott@yahoo.com&amp;gt; wrote in message &amp;lt;gl35f9$arm$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; hello&lt;br&gt;
&amp;gt; I want to assign the name of a variable based on loop iteration. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; b = [3 4 ]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Iteration = 1: 2&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ['abc' num2str(Iteration)] =   b(i) &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; End&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; But it does not work&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Any hint ?&lt;br&gt;
&lt;br&gt;
Yes, that wouldn't work. Have you tried using eval as follows?&lt;br&gt;
&lt;br&gt;
eval(['abc' num2str(Iteration) '=   b(i);']) </description>
    </item>
    <item>
      <pubDate>Tue, 20 Jan 2009 01:27:01 -0500</pubDate>
      <title>Re: num2str in loop</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/242704#622634</link>
      <author>Matt Fig</author>
      <description>Wow, I have never seen so many of these in such a short period of time!&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
It is very much recommended that you do not do this.  Use cell arrays instead.&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://matlabwiki.mathworks.com/MATLAB_FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F&quot;&gt;http://matlabwiki.mathworks.com/MATLAB_FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
\RN\Y\YNlalsXsUb\ZN]\NllTlVza:N2fFlR]\[Uc'-alOOlbRN[ZRNUPPV</description>
    </item>
  </channel>
</rss>

