title: Iterate through vector
body: <p>I wrote this (<code>column</code>, <code>row</code> and <code>value</code> are vectors):</p>
  
  <pre><code>for k = column
      for l = row ((column == k) &amp; (row &gt; k))
          A_lk = value (row == l &amp; column == k);
  </code></pre>
  
  <p>The problem is that <code>k</code> and <code>l</code> are vectors so I can't write <code>row == l</code> or <code>column == k</code> (I want those <code>i</code> for which <code>row (i)</code> is <code>l</code> and <code>column (i)</code> is <code>k</code>). </p>
  
  <p>The exact error is: "<code>mx_el_eq: nonconformant arguments (op1 is 46x1, op2 is 13x1)</code>".</p>
  
  <p>How can I use all elements in column and row <code>((column == k) &amp; (row &gt; k))</code> one by one?</p>
  
  <p>I thought about something like:</p>
  
  <pre><code>for i = 1:length(column)
      k = column (i)
  </code></pre>
  
  <p>Is there any other possibility?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>As I said, I have a sparse matrix (n, n). I have to iterate through all columns and for each column (say, k) I have to iterate through the lines from k+1 to n and do something with the non-zero elements.</p>
  
  <p>Example:  </p>
  
  <pre><code>row    = [1 3 3 2 1 2]      % row &gt; 2 is [0 1 1 0 0 0] 
  column = [1 1 2 2 2 3]  % column == 2 is [0 0 1 1 1 0]  
  value  = [8 7 9 5 6 7]  %(column == 2) &amp; (row &gt; 2) is [0 0 1 0 0 0] 
  </code></pre>
  
  <p><code>row ((column == 2) &amp; (row &gt; 2))</code> is 3<br>
  <code>value (row == 3 &amp; column == 2)</code> is 9  </p>
  
  <p>What I want the code to do:  </p>
  
  <pre><code>k in {1, 2, 3}  %writing this I realized I did some useless operations, 
                  %since I want just the distinct values of column
  k = 1:  
      l in row ((column == 1) &amp; (row &gt; 1)) = {3}  
          l = 3:
              A_31 = value (row == 3 &amp; column == 1) = 7
              %rest of the code
  k = 2:
      l in row ((column == 2) &amp; (row &gt; 2)) = {3}
          l = 3
              A_32 = value (row == 3 &amp; column == 2) = 9
              %rest of the code
  k = 3:
      l in row ((column == 3) &amp; (row &gt; 3)) = nothing
  </code></pre>