title: Accessing array elements
body: <p>I have a small problem, which I think it will be easy for you to figure out. But still I'm not a good programmer. Anyway, the problem is that I need to access the matrix element (20*2), this matrix is representing x,y locations for 20 features in image. I need to have a parameter that can give me the value of all them as x and another one for y; for example P = (all x values) and q= (all y values) in order to use them to draw on the image.</p>
  <p>The function for creating the matrix is an opencv function.</p>
  <pre><code>CvMat* mat = cvCreateMat(20,2,CV_32FC1);
  </code></pre>
  <p>which this matrix has the  values of frame features in x,y. I have used this code to print it out:</p>
  <pre><code>float t[20][2];
  for (int k1=0; k1&lt;20; k1++) {
       for (int k2=0; k2&lt;2; k2++) {
              t[k1][k2] = cvmGet(mat,k1,k2);
              std::cout&lt;&lt; t[k1][k2]&lt;&lt;&quot;\t&quot;;
       }
  }
  std::cout &lt;&lt;&quot;     &quot;&lt;&lt; std::endl;
  std::cout &lt;&lt;&quot;     &quot;&lt;&lt; std::endl;
  std::cout &lt;&lt;&quot;     &quot;&lt;&lt; std::endl;
  </code></pre>
  <p>This code work out well, but as I mentioned above guys, that I want to sign the values to a parameters in order to use them?</p>