title: Select some element of a Cell by index - faster than for structure
body: <p>some small questions!</p>
  
  <ol>
  <li>How can I create a null N-by-N cell in matlab?</li>
  <li>I have a N-by-3 matrix</li>
  </ol>
  
  <p><code>rv=...        %# [N-by-3]</code></p>
  
  <p><code>r=sqrt(sum(rv,2).^2);</code>
  <code>if r &lt; b</code></p>
  
  <p><code>statement1</code></p>
  
  <p><code>end</code></p>
  
  <p>Statement is save the index of r in a vector (like C).
  Something like this: C=[1 3 4 7 9 ,…]
  By use of this vector I want to select some element of a N-by-N matrix 
     Each element of a 2D matrix has 2 indexes: (i, j). If both of them be in the vector of indexes(C) then choose it and save it’s index in a cell
  Something like this: D={[2x1] [2x1] …  }
  Thanks a lot for any guide.
  Whishes</p>
  
  <p>=================================================================================</p>
  
  <p>For the second one :</p>
  
  <pre><code>p=1
  for i=1:N
      if r(i)&lt;R
          L(p)=i;
          p=p+1;
      end
  end
  
  
  L=[.....];
  
  for i=1:length(L)
      for j=1:length(L)
          D{i,j}=C{L(i),L(j)};
      end
  end
  </code></pre>
  
  <p>but problem is that it has a for structure and is very slow. I'am looking for something faster. perhaps with  <code>combnk</code> </p>