title: Algorithm to express elements of a matrix as a vector
body: <p><strong>Statement of Problem:</strong></p>
  
  <ol>
  <li><p>I have an array <code>M</code> with <code>m</code> rows and <code>n</code> columns.  The array <code>M</code> is filled with non-zero elements.  </p></li>
  <li><p>I also have a vector <code>t</code> with <code>n</code> elements, and a vector <code>omega</code>
      with <code>m</code> elements.</p></li>
  <li><p>The elements of <code>t</code> correspond to the columns of matrix <code>M</code>.</p></li>
  <li><p>The elements of <code>omega</code> correspond to the rows of matrix <code>M</code>.</p></li>
  </ol>
  
  <p><strong>Goal of Algorithm:</strong></p>
  
  <p>Define <code>chi</code> as the multiplication of vector <code>t</code> and <code>omega</code>.  <em>I need to obtain a 1D vector <code>a</code>, where each element of <code>a</code> is a function of <code>chi</code>.</em></p>
  
  <p>Each element of <code>chi</code> is unique (i.e. every element is different).</p>
  
  <p>Using mathematics notation, this can be expressed as <code>a(chi)</code></p>
  
  <p>Each element of vector <code>a</code> corresponds to an element or elements of <code>M</code>. </p>
  
  <p><strong>Matlab code:</strong></p>
  
  <p>Here is a code snippet showing how the vectors <code>t</code> and <code>omega</code> are generated.  The matrix <code>M</code> is pre-existing.</p>
  
  <pre><code>[m,n] = size(M);
  t = linspace(0,5,n);
  omega = linspace(0,628,m);
  </code></pre>
  
  <p><strong>Conceptual Diagram:</strong></p>
  
  <p><strong>This appears to be a type of integration (if this is the right word for it) along constant chi.</strong></p>
  
  <p><img src="https://i.stack.imgur.com/AXkQa.png" alt="Diagram"></p>
  
  <p><strong>Reference:</strong></p>
  
  <p><a href="http://www.scribd.com/doc/45448335/SEISMIC-INVERSE-q-FILTERING#page=208" rel="nofollow noreferrer">Link to reference</a></p>
  
  <p>The algorithm is not explicitly stated in the reference.  I only wish that this algorithm was described in a manner reminiscent of computer science textbooks! </p>
  
  <p>Looking at Figure 11.5, the matrix M is Figure 11.5(a).  The goal is to find an algorithm to convert Figure 11.5(a) into 11.5(b).</p>
  
  <p>It appears that the algorithm is a type of integration (averaging, perhaps?) along constant <code>chi</code>.</p>