manipulating lists
<p>I have written a code to manipulate the contents of a time series data and output into a newly created matrix. This is to enable me construct the phase space for the time series data.</p>

<p>The list is one-dimensional of length=N called "noise".</p>

<p>I want to create a MxN matrix where <code>m = N -5*tdelay1</code> and <code>n = 6</code>. When the code complies it displays an error:</p>

<blockquote>
  <p>Index was outside the bounds of the array.</p>
</blockquote>

<p>The code is below:</p>

<pre><code>float[,] phaseSpace6 = new float[(length-5*tdelay1-1), m];
for (int i = 0; i &lt; (length-5* tdelay1-1); i++)
{
    int col1 = i + tdelay1;
    int col2 = i + 2 * tdelay1;
    int col3 = i + 3 * tdelay1;
    int col4 = i + 4 * tdelay1;
    int col5 = i + 5 * tdelay1;
    phaseSpace6[i, 1] = noise[i];
    phaseSpace6[i, 2] = noise[col1];
    phaseSpace6[i, 3] = noise[col2];
    phaseSpace6[i, 4] = noise[col3];
    phaseSpace6[i, 5] = noise[col4];
    phaseSpace6[i, 6] = noise[col5];
}
</code></pre>

<p>I am not sure why this is happening, as someone new to programming. I will be grateful if some experienced person could help me out.</p>
