NaN returned when converting string to number within a for loop
<pre><code>for n=1:37
    for m=2:71
        rep1 = regexp(Cell1{n,m}, 'f[0-9]*', 'match')
        rep2 = regexp(rep1, '[0-9]*', 'match')
        rep2 = [rep2{:}]
        cln = str2double(rep2)
        Cell2{n,cln} = Cell1{n,m}
    end
end
</code></pre>

<p>Cell 1 is a 37x71 Cell, Cell 2 is a 37x71 empty cell.</p>

<p>Ex</p>

<pre><code> Cell1{1,2} = -(f32.*x1.*x6)./v1
</code></pre>

<p>If I run each part of the loop above individually, the function works as intended.  However, it returns <code>cln</code> as a NaN when the whole loop is executed.  </p>